Are Laws Specifications and Trials Production Tests? Understanding Legal Systems Through Input, Implementation, and Feedback

プログラミング・Web開発カテゴリを表すパンダのイラスト Programming / Web Development

About This Article
This article is created using an automated generation workflow leveraging generative AI. Based on primary sources from e-Gov, the Cabinet Legislation Bureau, the Ministry of Health, Labour and Welfare, the Ministry of Justice, courts, and others, the legal system is organized using an IT development and operation model consisting of "INPUT / DEVELOPMENT / PERMISSION / RUNTIME / FEEDBACK." The latter half also implements management samples using Excel, VBA, and PowerShell.

Verification Status: 📘 Primary sources verified and designed not to automate legal judgments

While studying for a certain qualification exam, I repeatedly encountered terms that seemed similar yet had different roles: laws, cabinet orders, ministerial ordinances, guidelines, notices, proposals, outlines, certification criteria…

Trying to memorize only the names and eras makes it difficult to retain the information.

Therefore, I tried reframing them in terms of familiar IT development and system operations.

By doing so, laws are not simply "rules decided by the state," but rather:

A massive social system that receives inputs from the production environment of society, is designed and implemented as an institution, operates in RUNTIME, and feeds the results back into the next revision.

This is how they begin to appear.

This article organizes the legal system using the following five elements.

INPUT
   ↓
DEVELOPMENT
   ↓
PERMISSION
   ↓
RUNTIME
   ↓
FEEDBACK
   └────────→ 次のINPUTへ

Furthermore, the second half explores methods to manage this mindset directly using Excel, VBA, and PowerShell.

This is not about having programs make legal judgments.

The goal is to convert laws, guidelines, and notices into managed objects defined by "what the basis is, what is implemented, when inspections occur, and what evidence is left behind.".


  1. 1. Overview – The Legal System as a Massive Feedback Loop
  2. 2. INPUT – What Materials are Laws Made From?
  3. 3. What Do Proposals, Reports, and Outlines Accomplish?
  4. 4. DEVELOPMENT – How Cabinet-Submitted Bills are Created
    1. The Cabinet Legislation Bureau acts as the "Legal Architecture Review"
  5. 5. PERMISSION – The Legal System as an "Authorization Model"
    1. A Child Module Cannot Arbitrarily Add Permissions Not Allowed by the Parent API
  6. 6. "Ease of Modification" and "Scope of Decisional Authority"
  7. 7. You Cannot Organize This Simply Using RFC MUST / SHOULD / MAY
  8. 8. Do Trials Create Laws?
  9. 9. Real-World Example of Precedents Becoming Inputs for Legislation – Duty of Care
  10. 10. The Abuse of Dismissal Rights Doctrine is Also an Example of "Precedent -> Codification"
  11. 11. Example Where Trials Surface Problems in Existing Specifications and Lead to Law Revision
  12. 12. Where to Research Precedents
  13. 13. Why Aren't All Detailed Rules Written in the "Law"?
  14. 14. The 2023 "Certification Criteria for Mental Disorders Caused by Psychological Load" is a Good Example
  15. 15. Public Comments Are Also a Form of FEEDBACK / INPUT
  16. 16. Viewing the Legal System as a PDCA Cycle
  17. 17. Synthesizing This Into a "Five-Layer Model"
  18. 18. Papanda Implementation Edition – Managing This Model in Excel
  19. 19. Conceptual Structure of the Excel Workbook
  20. 20. Excel Management Table Image ① – Sources
  21. 21. Excel Management Table Image ② – Requirements / Controls
  22. 22. Excel Management Table Image ③ – Managing Law Revisions as Versions
  23. 23. Separating "Columns for Human Judgment" and "Columns for Machine Determination" in Excel
    1. Things Easy for Machines to Determine
    2. Things Humans Should Judge
  24. 24. VBA Sample – Person in Charge Checking Deadlines Upon Opening Excel
    1. Processing Easy to Delegate to VBA
  25. 25. PowerShell Sample – Periodic Monitoring
  26. 26. Creating an HTML Report with PowerShell
  27. 27. Division of Roles Between VBA and PowerShell
  28. 28. Running PDCA on This Mechanism Itself
  29. 29. Thinking of the Legal System as a Database is Even More Interesting
  30. 30. Important: Do Not Stuff Consultation Details and Personal Information Too Much into This Ledger
  31. 31. Practical Checklist When Reading Laws
  32. 32. Order of Researching Primary Sources
  33. 33. Collection of Primary Source Links to Save
    1. Confirming Laws Themselves
    2. Confirming the Process of Making Laws
    3. Viewing Administrative System Design and Public Comments
    4. Viewing Precedents
    5. Viewing Case Law Doctrines and the Labor Contract Act
    6. Viewing Specific Examples of Trials Leading to Law Revisions
    7. Viewing Workers' Accident Compensation Criteria for Mental Disorders
  34. 34. Conclusion – Laws Are Not "Finished Products" But "Systems in Operation"

1. Overview – The Legal System as a Massive Feedback Loop

flowchart LR
    subgraph INPUT["INPUT:社会から入ってくる情報"]
        I1[社会問題]
        I2[事故・重大事件]
        I3[裁判・判例]
        I4[統計・調査]
        I5[行政実務]
        I6[専門家・研究]
        I7[当事者・業界]
        I8[世論・報道]
        I9[国際動向]
        I10[新技術・災害]
    end

    subgraph DEV["DEVELOPMENT:制度を設計する"]
        D1[問題認識]
        D2[調査・検討]
        D3[報告書・提言]
        D4[大綱・基本方針等]
        D5[制度設計]
        D6[法案]
        D7[法制面の審査・調整]
        D8[国会審議]
    end

    subgraph CORE["CORE"]
        L[法律]
    end

    subgraph DETAIL["DETAIL:詳細化"]
        R1[政令]
        R2[省令]
        R3[告示・法定指針]
        R4[通達・通知]
        R5[認定基準・審査基準等]
    end

    subgraph RUN["RUNTIME:社会で動かす"]
        O1[行政実務]
        O2[企業実装]
        O3[現場運用]
    end

    subgraph FEEDBACK["FEEDBACK:運用結果"]
        F1[裁判]
        F2[統計]
        F3[行政上の課題]
        F4[新しい社会問題]
        F5[技術・環境変化]
    end

    INPUT --> D1
    D1 --> D2 --> D3
    D3 --> D5
    D3 --> D4
    D4 --> D5
    D5 --> D6 --> D7 --> D8 --> L

    L --> R1
    L --> R2
    L --> R3

    R1 --> R4
    R2 --> R4
    R3 --> R4
    R4 --> R5

    R1 --> RUN
    R2 --> RUN
    R3 --> RUN
    R4 --> RUN
    R5 --> RUN

    RUN --> FEEDBACK
    FEEDBACK --> D1

The most important part of this diagram is:That it does not end at the right edge, but loops back to the left.

Laws are not:

作る
↓
公布する
↓
終わり

.

Rather, they have a lifecycle of:

リリース
↓
本番運用
↓
ログを見る
↓
不具合・新要求を発見
↓
次バージョンを設計

.

However, this diagram is an explanatory model. Not all laws strictly follow the same sequence of "discussion groups -> proposals -> outlines -> bills." Some bills are submitted by the Cabinet, while others are submitted by Diet members or parliamentary committees.

It is important to grasp from the outset that there is no single CI/CD pipeline for laws.


2. INPUT – What Materials are Laws Made From?

When hearing about "making a law," one might easily imagine starting to write provisions from a blank sheet of paper.

However, even for systems that appear to be brand-new legislation, demands have usually accumulated within society beforehand.

INPUT from the Real World IT Development Analogy Insights from System Design
Social Issues User Issue New System Requirements
Accidents and Major Incidents Major Incident Unexpected cases and severe risks
Trials and Precedents Production Case / Regression Test Ambiguous interpretations and limits of existing rules
Administrative Practices Operations Feedback Operational difficulties, exception handling, and procedural issues
Statistics and Surveys Logs / Metrics / KPI Occurrence frequency, trends, and impact scope
Academic Research Technical Research Root cause analysis and new insights
Expert Opinions Design Review Policy alternatives and risk assessment
Stakeholders and Industry Associations Stakeholder Request On-site requirements
Public Opinion and Media User Feedback / External Review Social interest and prioritization
International Treaties and Overseas Systems External Standard Requirements for international alignment
Contradictions in Existing Systems Technical Debt Inconsistencies between laws and outdated assumptions
Disasters and Pandemics Environment Change Changes in prerequisites
New Technologies Like AI Platform Change Domains unanticipated by existing systems

Even when speaking of "making a law from scratch," the reality is often closer to:

Unorganized requirements and incident reports accumulating sufficiently to launch a formal development project

Viewing it this way makes it much easier to understand.


3. What Do Proposals, Reports, and Outlines Accomplish?

This is another area that is easier to understand if we avoid viewing it as a simple hierarchical relationship.

Document IT Analogy Role
Investigation Report Investigation Report Organizing current conditions, data, and issues
Review Meeting Report Design Review Result Clarification of discussion points by experts
Proposal Requirement Proposal Presenting the direction of "how things should change"
Outline Product Vision / Master Plan Broad direction and basic concept of overall policy
Bill Release Candidate State ready for formal deliberation as statutory provisions
Law Core Specification Formal legal norm

In particular, an "outline" should not be considered a step below a law simply based on its name. While used as a document indicating the broad direction of policies and systems, its legal positioning and creating body vary depending on the individual outline.

Therefore:

大綱 = 必ず法律の直前に存在する成果物

.

In IT terms, this is equivalent to saying that not every new system necessarily has a file named MasterPlan.md.

What matters isthe role, not the file name.


4. DEVELOPMENT – How Cabinet-Submitted Bills are Created

The Cabinet Legislation Bureau publishes information on "how laws are made" regarding cabinet-submitted bills.

Roughly speaking, individual ministries and agencies examine policies, draft initial proposals, coordinate with related ministries, conduct deliberations or public hearings as necessary to turn them into legal text, undergo review by the Cabinet Legislation Bureau, receive cabinet approval, and submit them to the Diet.

flowchart TD
    A[政策上の課題]
    --> B[所管省庁<br>Requirements]

    B --> C[制度設計<br>Basic Design]
    C --> D[関係省庁調整<br>Integration Review]
    D --> E[審議会・意見聴取等<br>Stakeholder Review]
    E --> F[法文化<br>Specification Draft]
    F --> G[内閣法制局審査<br>Architecture / Legal Review]
    G --> H[閣議決定<br>Release Approval]
    H --> I[国会提出]
    I --> J[委員会審査]
    J --> K[本会議]
    K --> L[成立]
    L --> M[公布・施行]

The Cabinet Legislation Bureau acts as the "Legal Architecture Review"

According to the Cabinet Legislation Bureau's explanation, cabinet-submitted bills are reviewed for:

  • Relationship with the Constitution and existing legislation
  • Legal validity of the legislative content
  • Whether legislative intent is accurately reflected in the provisions
  • Provision structure
  • Characters and terminology

And other aspects.

Translated into IT terms, this is like performing

Architecture Review
+
Compatibility Check
+
Static Analysis
+
Code Review
+
Lint

all at once.

Primary Source


5. PERMISSION – The Legal System as an "Authorization Model"

This brings us to another essential axis.

If you view laws, cabinet orders, ministerial ordinances, guidelines, and notices using only a single gauge where higher means stronger and lower means weaker, you are likely to misunderstand them.

What you need to look at is:

  • Who creates it
  • Who can modify it
  • What procedures it goes through
  • How far its decisions can reach
  • What authority has been delegated to it by higher-level laws
  • Whom it targets
  • What effects occur in case of violations

.

flowchart TB
    C[憲法<br>Architecture Constraints]

    L[法律<br>Core Specification<br>権限境界]

    O[政令<br>Detailed Design]
    M[省令<br>Detailed Configuration]
    G[法定指針<br>Implementation Guide]
    N[通達・通知・認定基準<br>Administrative Runbook / Rule Engine]

    P[行政・企業・社会で実装]

    C --> L
    L -->|法律の実施・委任| O
    L -->|法律等の実施・委任| M
    L -->|根拠法に基づく具体化| G

    O --> M
    M --> N
    G --> N

    O --> P
    M --> P
    G --> P
    N --> P

A Child Module Cannot Arbitrarily Add Permissions Not Allowed by the Parent API

Article 41 of the Constitution of Japan designates the Diet as "the sole law-making organ of the State."

Furthermore, Article 73, Item 6 of the Constitution stipulates that while the Cabinet may enact cabinet orders to execute the Constitution and laws,penal provisions cannot be established in cabinet orders without special delegation from a law.

Article 12 of the National Government Organization Act states that ministerial ordinances may be issued based on the execution of laws and cabinet orders or special delegation, and without statutory delegation, ministerial ordinances alone cannot establish penal provisions, impose obligations, or restrict the rights of citizens.

Therefore, you cannot rewrite guidelines to suddenly create a new criminal penalty such as "10 years of imprisonment for violations."

To carry heavy legal effects, corresponding legal foundations and procedures are necessary.

Primary Source


6. "Ease of Modification" and "Scope of Decisional Authority"

System / Document IT Analogy Primary Entity Modification Cost Scope of Decisions Basis / Constraints
Constitution Architecture Constraints Constitutional Amendment Procedure Extremely High Basic framework for state governance and fundamental human rights The Constitution itself
Law Core Specification Diet High Regulates rights, obligations, etc. within the scope of the Constitution Constitution
Cabinet Order Detailed Design Cabinet Generally more agile than laws Execution and delegation scope of laws Constitution and Laws
Ministerial Ordinance Detailed Configuration Ministers of respective ministries Relatively agile Execution and delegation scope of laws and cabinet orders Laws and Cabinet Orders
Statutory Guidelines Implementation Guide Jurisdictional Ministers, etc. Depends on the system Scope of concretization defined in the enabling law Enabling Laws, etc.
Notices and Circulars Administrative Runbook Administrative Organs Relatively agile Internal administrative interpretation and operation Higher-level laws and systems
Certification Criteria Rule Engine Administrative Organs Relatively agile Administrative judgments based on systems Higher-level laws and notices, etc.
Internal Company Regulations Organization Implementation Enterprises Based on internal procedures Within the scope not violating laws and regulations Laws, labor contracts, etc.

The "modification cost" in this table is a generalization for understanding.

It does not necessarily follow that:

Easy to modify = legally weak

.


7. You Cannot Organize This Simply Using RFC MUST / SHOULD / MAY

As an engineer, you might be tempted to assign:

法律 = MUST
指針 = SHOULD
通知 = MAY

.

However, this classification is risky.

Even among guidelines, some are established based on statutory provisions to concretize legal obligations. Furthermore, a single guideline may contain a mix of provisions concretizing legally required measures alongside "desirable practices."

Therefore, rather than just looking at the document name, you need to look at:

DocumentType
Issuer
LegalBasis
Target
RequirementType
EffectiveDate
Consequence

.

This is easy to understand if you think of it as themetadataof the legal system.


8. Do Trials Create Laws?

This is a point where confusion is especially likely.

Trials themselves are not laws.

Article 76 of the Constitution of Japan vests judicial power in the courts and stipulates that judges are bound by the Constitution and laws.

To use an IT analogy, this is like:

法律
= Specification

具体的事件
= Production Input

裁判
= Specificationを実案件へ適用する判定処理

判決
= Result

判例
= 過去の重要な判断ログ / Regression Test Case

.

While the expression "trials = bug-finding devices" is easy to understand, the purpose of courts is not to search for bugs in laws.

More accurately, it is helpful to think that:

As a result of applying specifications to production cases, ambiguities in specifications and systematic issues may become visualized

.


9. Real-World Example of Precedents Becoming Inputs for Legislation – Duty of Care

An easy-to-understand example for understanding this model is Article 5 of the Labor Contract Act.

The Ministry of Health, Labour and Welfare's enforcement notice on the Labor Contract Act explains that while the duty of care had originally been recognized in judicial precedents, it was not explicitly clear from the provisions of the Civil Code; therefore, Article 5 of the Labor Contract Act was enacted to stipulate that employers bear a duty of care.

flowchart LR
    A[具体的な事故・紛争]
    --> B[裁判]
    B --> C[判例上<br>安全配慮義務を形成]
    C --> D[実務で判断が蓄積]
    D --> E[条文上分かりにくい<br>予測可能性の課題]
    E --> F[労働契約法]
    F --> G[第5条で明文化]

This is an example close to the flow of:

Production Cases
↓
Rule discovered in operation
↓
Specificationへ正式採用

.

Primary Source


10. The Abuse of Dismissal Rights Doctrine is Also an Example of "Precedent -> Codification"

Article 16 of the Labor Contract Act is also an interesting example.

The Ministry of Health, Labour and Welfare's notice explains that this provision codifiesthe doctrine of abuse of dismissal rights established by Supreme Court rulings.

flowchart LR
    A[解雇をめぐる紛争]
    --> B[裁判]
    B --> C[解雇権濫用法理]
    C --> D[判例法理として確立]
    D --> E[労働契約法16条]
    E --> F[成文法として確認しやすくなる]

This is not "the courts made a law," but rather

the legislative side subsequently incorporated judgment rules formed and established through trials into statutory law

, which is the appropriate way to understand it.


11. Example Where Trials Surface Problems in Existing Specifications and Lead to Law Revision

There is also another pattern.

In 2013, the Supreme Court ruled that the provision under the civil code at the time—which set the statutory inheritance share of a child born out of wedlock to half that of a child born in wedlock—was unconstitutional. Subsequently, the Civil Code was amended to make the inheritance shares equal.

flowchart LR
    V1[民法 v1]
    --> P[具体的事件]
    P --> J[最高裁]
    J --> X[既存仕様の一部を<br>憲法違反と判断]
    X --> C[法改正]
    C --> V2[民法 v2]

Primary Source


12. Where to Research Precedents

The courts provide an official judicial precedent search.

However, as explicitly stated on the court's website, not all judgments are published.


13. Why Aren't All Detailed Rules Written in the "Law"?

This raises a question.

If they have to be followed anyway, why not write everything in the main body of the law?

However, if all judgment criteria and responses to social changes were fixed within the main body of the law, major legislative amendment procedures would be required for every minor change.

In IT terms, this is like

設定値を1つ変更するために
OSカーネルを毎回ビルドし直す

.

Therefore,

安定させたいCore
+
状況に応じて変更するConfiguration / Rule

is separated.


14. The 2023 "Certification Criteria for Mental Disorders Caused by Psychological Load" is a Good Example

In 2023, the Ministry of Health, Labour and Welfare revised the standards for recognizing mental disorders caused by psychological load as industrial accidents.

As background, changes in recent social conditions, an increase in industrial accident claims, the latest medical insights, and deliberations by expert review committees were cited.

The revisions included:

  • Adding customer harassment to specific events
  • Adding work operations with a high risk of infectious diseases or accidents
  • Clarifying and expanding specific examples of the six types of power harassment

And other changes.

flowchart LR
    A[社会情勢の変化]
    B[労災請求データ]
    C[医学的知見]
    D[既存運用]

    A --> E[専門検討会]
    B --> E
    C --> E
    D --> E

    E --> F[検討会報告書]
    F --> G[認定基準改正]
    G --> H[労働局の認定実務]
    H --> I[新しい申請・統計・課題]
    I --> E

The 2023 certification criteria are established as a notice from the Director-General of the Labour Standards Bureau of the Ministry of Health, Labour and Welfare to the Directors-General of the Prefectural Labour Bureaus.

Translated into IT, viewing it as

a Rule Engine for administrative judgments operating on top of the Core of the workers' accident compensation system

makes it easier to visualize.

Primary Source


15. Public Comments Are Also a Form of FEEDBACK / INPUT

When establishing cabinet orders or ministerial ordinances, public comment procedures based on the Administrative Procedure Act are sometimes conducted.

Release Candidate
↓
Public Preview
↓
External Review
↓
Feedback
↓
Final Release

e-Gov explains this as a mechanism where drafts are published when establishing cabinet or ministerial orders, opinions and information are widely solicited, and their contents are taken into consideration.

Submitted opinions are not processed by a simple majority vote, but their contents are duly considered.

Official Links


16. Viewing the Legal System as a PDCA Cycle

flowchart LR
    P["PLAN<br>社会問題・統計・裁判を分析<br>制度設計"]
    D["DO<br>法律・政省令・指針を整備<br>行政・企業で実装"]
    C["CHECK<br>裁判・統計・行政運用<br>制度の効果を評価"]
    A["ACT<br>法改正・基準改正<br>運用改善"]

    P --> D
    D --> C
    C --> A
    A --> P

In other words, laws are not built once via waterfall and finished; they can be said to be a PDCA cycle that rotates continuously across society over long periods.


17. Synthesizing This Into a "Five-Layer Model"

flowchart TB
    I["1. INPUT<br>社会問題・事故・裁判・統計・研究"]
    D["2. DEVELOPMENT<br>検討・提言・大綱・制度設計・立法"]
    P["3. PERMISSION<br>誰が何をどこまで決められるか"]
    R["4. RUNTIME<br>行政・企業・現場で運用"]
    F["5. FEEDBACK<br>裁判・統計・運用上の問題"]

    I --> D
    D --> P
    P --> R
    R --> F
    F --> I
Layer Questions to Ask Yourself
INPUT Why did this system become necessary?
DEVELOPMENT Through what process was it institutionalized?
PERMISSION Who decides what, based on what authority, and to what extent?
RUNTIME How is it specifically operated in society and enterprises?
FEEDBACK What issues were returned as a result of actual operation?

Asking these five questions before memorizing law names or eras makes understanding much easier.


18. Papanda Implementation Edition – Managing This Model in Excel

So far, we have discussed the theory.

What happens if we turn this concept intoan actual management tool?

First, the simplest option is Excel.

The goal is not to store the laws themselves.

What we want to manage is

どの資料を読んだのか
↓
何が要求されているのか
↓
自分の組織では何を実装するのか
↓
誰が担当するのか
↓
いつ点検するのか
↓
証跡はどこにあるのか
↓
法改正があったら何を見直すのか

.


19. Conceptual Structure of the Excel Workbook

flowchart TB
    WB[Law-System-Control.xlsx]

    WB --> S1[01_Sources<br>法令・指針・提言等]
    WB --> S2[02_Requirements<br>要求事項]
    WB --> S3[03_Controls<br>自社実装・統制]
    WB --> S4[04_Evidence<br>証跡]
    WB --> S5[05_Reviews<br>点検]
    WB --> S6[06_Actions<br>改善]
    WB --> S7[07_ChangeLog<br>改正・変更履歴]
    WB --> S8[08_Dashboard<br>可視化]

20. Excel Management Table Image ① – Sources

01_Sources is a ledger of primary sources.

SourceID Layer DocumentType Title Issuer LegalBasis EffectiveDate Status URL LastChecked
SRC-001 CORE Law Labor Contract Act State 2008-03-01 Current e-Gov, etc. 2026-09-15
SRC-002 RULE Notice Certification Criteria for Mental Disorders Director-General of MHLW Labour Standards Bureau Workers' Accident Compensation System 2023-09-01 Current MHLW 2026-09-15
SRC-003 INPUT Report Expert Review Committee Report MHLW Review Committee 2023-07 Historical Input MHLW 2026-09-15

What is important here isnot putting proposals and reports into the same "strength" column as laws.

Instead, you assign Layer like

INPUT
CORE
DETAIL
GUIDE
RUNBOOK
RULE

.


21. Excel Management Table Image ② – Requirements / Controls

Next, separate the requirements extracted from documents from your organization's implementation.

ControlID SourceID Requirement Implementation Owner ReviewCycleDays LastReview NextReview Status EvidencePath
CTL-001 SRC-001 Ensure duty of care Establish safety and health management procedures General Affairs 365 2026-04-01 2027-04-01 OK Evidence/CTL-001/
CTL-002 SRC-002 Refer to latest certification criteria Review procedures when criteria update HR 180 2026-04-01 2026-09-28 Attention Evidence/CTL-002/
CTL-003 SRC-003 Understand social trend changes Check review committee materials annually In Charge 365 2025-10-01 2026-10-01 Attention Evidence/CTL-003/

Here, we build traceability like

Source
↓
Requirement
↓
Control
↓
Evidence

.


22. Excel Management Table Image ③ – Managing Law Revisions as Versions

ChangeID SourceID DetectedDate ChangeType OldVersion NewVersion EffectiveDate Impact ActionStatus
CHG-001 SRC-002 2023-09-01 Revised 2011 2023 2023-09-01 High Completed
CHG-002 SRC-XXX 2026-09-01 Future Current Next 2026-10-01 Medium Reviewing

This is management of

Current
Future
Superseded

what corresponds to a release log in IT.

flowchart LR
    C[Current]
    -->|改正公布・発出| F[Future]

    F -->|施行・適用日| N[New Current]

    C -->|置換| S[Superseded]

    N --> C2[次のCurrent]

23. Separating "Columns for Human Judgment" and "Columns for Machine Determination" in Excel

Things Easy for Machines to Determine

  • Next review date has passed
  • URL is empty
  • EvidencePath is empty
  • File does not exist
  • Last check date is old
  • Status is Future but the effective date has passed

Things Humans Should Judge

  • How this guideline applies to our company
  • Whether the impact of the law revision is significant
  • What an individual incident legally corresponds to
  • How to apply judicial precedents to our company's cases
  • Whether this control is sufficient
flowchart LR
    A[Excel / Script]
    --> B[期限・欠落・差分を検出]

    B --> C[人間へAlert]
    C --> D[法令・一次情報を確認]
    D --> E[影響・対応を判断]
    E --> F[管理表を更新]

What to automate is not the judgment itself, but finding the places where judgment is needed.


24. VBA Sample – Person in Charge Checking Deadlines Upon Opening Excel

For small-scale operations centered on Excel, VBA is convenient.

The following example looks at the 03_Controls sheet, and updates status to NextReview if OVERDUE is in the past, ATTENTION if within 30 days, and OK otherwise.

Option Explicit

Public Sub CheckControlReviewDates()

    Const SHEET_NAME As String = "03_Controls"
    Const HEADER_ROW As Long = 1

    Dim ws As Worksheet
    Dim lastRow As Long
    Dim colNextReview As Long
    Dim colStatus As Long
    Dim i As Long
    Dim nextReview As Variant

    Set ws = ThisWorkbook.Worksheets(SHEET_NAME)

    colNextReview = FindHeaderColumn(ws, HEADER_ROW, "NextReview")
    colStatus = FindHeaderColumn(ws, HEADER_ROW, "Status")

    If colNextReview = 0 Or colStatus = 0 Then
        MsgBox "NextReview または Status 列が見つかりません。", vbExclamation
        Exit Sub
    End If

    lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row

    For i = HEADER_ROW + 1 To lastRow

        nextReview = ws.Cells(i, colNextReview).Value

        If IsDate(nextReview) Then

            If CDate(nextReview) < Date Then
                ws.Cells(i, colStatus).Value = "OVERDUE"

            ElseIf CDate(nextReview) <= Date + 30 Then
                ws.Cells(i, colStatus).Value = "ATTENTION"

            Else
                ws.Cells(i, colStatus).Value = "OK"
            End If

        Else
            ws.Cells(i, colStatus).Value = "NO DATE"
        End If

    Next i

    MsgBox "レビュー期限の確認が完了しました。", vbInformation

End Sub

Private Function FindHeaderColumn( _
    ByVal ws As Worksheet, _
    ByVal headerRow As Long, _
    ByVal headerName As String _
) As Long

    Dim hit As Range

    Set hit = ws.Rows(headerRow).Find( _
        What:=headerName, _
        LookIn:=xlValues, _
        LookAt:=xlWhole, _
        MatchCase:=False _
    )

    If hit Is Nothing Then
        FindHeaderColumn = 0
    Else
        FindHeaderColumn = hit.Column
    End If

End Function

Processing Easy to Delegate to VBA

  • Checking deadlines upon button press
  • Checking mandatory input fields
  • Creating new inspection checklists
  • Creating PDF documents
  • Updating dashboards
  • Opening the Evidence folder for the selected Control
  • Bulk entering "Current Inspection Date"

In short, its role is to

support the work performed by humans inside Excel

.


25. PowerShell Sample – Periodic Monitoring

PowerShell can run even during times when no one has Excel open.

For example, export a CSV from the Excel management table and execute it weekly using the Windows Task Scheduler or similar tools.

The assumed CSV columns are:

ControlID
Title
Owner
NextReview
EvidencePath
SourceURL

.

param(
    [string]$InputCsv = ".\control-register.csv",
    [string]$OutputDirectory = ".\out",
    [int]$WarningDays = 30
)

Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"

if (-not (Test-Path -LiteralPath $InputCsv)) {
    throw "Input CSV not found: $InputCsv"
}

New-Item -ItemType Directory `
    -Path $OutputDirectory `
    -Force | Out-Null

$today = (Get-Date).Date
$controls = Import-Csv -LiteralPath $InputCsv

$result = foreach ($control in $controls) {

    $reviewStatus = "NO_DATE"
    $nextReview = $null

    if (-not [string]::IsNullOrWhiteSpace($control.NextReview)) {
        $parsed = [datetime]::MinValue

        if ([datetime]::TryParse($control.NextReview, [ref]$parsed)) {
            $nextReview = $parsed.Date

            if ($nextReview -lt $today) {
                $reviewStatus = "OVERDUE"
            }
            elseif ($nextReview -le $today.AddDays($WarningDays)) {
                $reviewStatus = "ATTENTION"
            }
            else {
                $reviewStatus = "OK"
            }
        }
        else {
            $reviewStatus = "INVALID_DATE"
        }
    }

    $evidenceStatus = "NO_PATH"

    if (-not [string]::IsNullOrWhiteSpace($control.EvidencePath)) {
        if (Test-Path -LiteralPath $control.EvidencePath) {
            $evidenceStatus = "EXISTS"
        }
        else {
            $evidenceStatus = "MISSING"
        }
    }

    [pscustomobject]@{
        ControlID      = $control.ControlID
        Title          = $control.Title
        Owner          = $control.Owner
        NextReview     = $control.NextReview
        ReviewStatus   = $reviewStatus
        EvidencePath   = $control.EvidencePath
        EvidenceStatus = $evidenceStatus
        SourceURL      = $control.SourceURL
        CheckedAt      = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
    }
}

$reportPath = Join-Path $OutputDirectory "control-check.csv"

$result |
    Export-Csv `
        -LiteralPath $reportPath `
        -NoTypeInformation `
        -Encoding UTF8

$alerts = $result | Where-Object {
    $_.ReviewStatus -in @(
        "OVERDUE",
        "ATTENTION",
        "INVALID_DATE"
    ) -or $_.EvidenceStatus -eq "MISSING"
}

$alertPath = Join-Path $OutputDirectory "control-alerts.csv"

$alerts |
    Export-Csv `
        -LiteralPath $alertPath `
        -NoTypeInformation `
        -Encoding UTF8

Write-Host "Checked : $($result.Count)"
Write-Host "Alerts  : $($alerts.Count)"
Write-Host "Report  : $reportPath"
Write-Host "Alert   : $alertPath"

Executing this allows you to

control-register.csv
        ↓
PowerShell
        ↓
control-check.csv
control-alerts.csv

.


26. Creating an HTML Report with PowerShell

Since CSV alone can be a bit dry, you might also want to generate HTML that can be checked in a browser.

$alerts |
    Select-Object `
        ControlID,
        Title,
        Owner,
        NextReview,
        ReviewStatus,
        EvidenceStatus |
    ConvertTo-Html `
        -Title "Law / Control Review Alerts" `
        -PreContent "<h1>Law / Control Review Alerts</h1>" `
        -PostContent "<p>Generated: $(Get-Date)</p>" |
    Set-Content `
        -LiteralPath ".\out\control-alerts.html" `
        -Encoding UTF8

This enables an operation style of

毎週月曜
↓
タスクスケジューラ
↓
PowerShell
↓
期限・証跡を自動確認
↓
HTMLレポート
↓
担当者が一次情報を見て判断

.


27. Division of Roles Between VBA and PowerShell

flowchart LR
    U[担当者]

    subgraph EXCEL["Excel"]
        A[Sources]
        B[Requirements]
        C[Controls]
        D[Evidence]
        E[Reviews]
        F[ChangeLog]
    end

    subgraph VBA["VBA:対話処理"]
        V1[入力チェック]
        V2[期限チェック]
        V3[帳票作成]
        V4[ダッシュボード更新]
    end

    subgraph PS["PowerShell:バッチ処理"]
        P1[定期実行]
        P2[Evidence存在確認]
        P3[期限監視]
        P4[HTML/CSV生成]
    end

    subgraph HUMAN["Human Review"]
        H[法令確認<br>影響評価<br>意思決定]
    end

    U --> EXCEL
    EXCEL --> VBA
    EXCEL --> PS
    VBA --> H
    PS --> H
    H --> EXCEL
Technology Role
Excel Data model, list view, human judgment
VBA Interactive processing within Excel
PowerShell Periodic batch processing, external file checks
Human Judging legal meaning, impact, and response policy

28. Running PDCA on This Mechanism Itself

You must not be satisfied just by creating a system management tool.

flowchart LR
    P["PLAN<br>一次情報・要求を登録"]
    D["DO<br>Controlを実装<br>証跡を保存"]
    C["CHECK<br>Excel/VBA/PowerShell<br>期限・証跡を点検"]
    A["ACT<br>手順・Control・管理項目を改善"]

    P --> D --> C --> A --> P

This structure is the same as the feedback loop of the legal system itself explained in this article.

In other words,

the system managing the system also needs to be continuously updated just like the system itself

.


29. Thinking of the Legal System as a Database is Even More Interesting

If you consider turning this into a database after Excel, the data model looks like this.

erDiagram
    SOURCE ||--o{ REQUIREMENT : contains
    REQUIREMENT ||--o{ CONTROL : implemented_by
    CONTROL ||--o{ EVIDENCE : evidenced_by
    CONTROL ||--o{ REVIEW : reviewed_by
    REVIEW ||--o{ ACTION : creates
    SOURCE ||--o{ CHANGE : revised_by

    SOURCE {
        string SourceID
        string DocumentType
        string Title
        string Issuer
        string URL
        date EffectiveDate
        string Status
    }

    REQUIREMENT {
        string RequirementID
        string SourceID
        string Requirement
    }

    CONTROL {
        string ControlID
        string RequirementID
        string Owner
        date NextReview
        string Status
    }

    EVIDENCE {
        string EvidenceID
        string ControlID
        string Path
        date EvidenceDate
    }

    REVIEW {
        string ReviewID
        string ControlID
        date ReviewDate
        string Result
    }

    ACTION {
        string ActionID
        string ReviewID
        string Action
        date DueDate
    }

    CHANGE {
        string ChangeID
        string SourceID
        date EffectiveDate
        string Impact
    }

Once organized to this extent, you can transition in the future to:

  • SQLite
  • Microsoft Lists
  • SharePoint Lists
  • Dataverse
  • Power Apps
  • Web apps

And other platforms.


30. Important: Do Not Stuff Consultation Details and Personal Information Too Much into This Ledger

It is safer to separate legal system management from actual individual case management.

For example, in the case of harassment consultations, they may contain highly sensitive information such as names, health information, detailed statements, investigation records, and stakeholder information.

Therefore, the appropriate design is to focus this Excel on

制度・Control・点検・Evidenceの管理

, while separating detailed individual case data into

アクセス制御された別システム

.


31. Practical Checklist When Reading Laws

When an unfamiliar document appears, review it in the following order.

# Check Item IT Analogy
1 What type of document is it? File Type
2 Who created it? Owner
3 What is its basis? Dependency
4 Who is the target? Scope
5 What does it require? Requirement
6 Is it an obligation, prohibition, voluntary obligation, or recommendation? Constraint
7 When is it effective? Release Date
8 Are there revision plans? Next Version
9 What happens upon violation or non-compliance? Failure Effect
10 What will be implemented on-site? Implementation
11 What is the evidence? Log / Evidence
12 Who will review it and when? Monitoring

Filling out this metadata before reading the legal text will organize your thoughts considerably.


32. Order of Researching Primary Sources

flowchart TD
    Q[疑問が発生]
    --> E[e-Gov法令検索<br>現行条文]

    E --> R{改正履歴・<br>未施行改正は?}
    R --> N[日本法令索引<br>制定・改廃・法案履歴]
    N --> M[所管省庁<br>制度ページ]
    M --> G[政省令・告示・指針]
    G --> T[通達・通知・認定基準]
    T --> C[検討会・報告書・提言]
    C --> J[裁判所<br>必要なら判例]
    J --> U[理解・管理表を更新]

33. Collection of Primary Source Links to Save

Confirming Laws Themselves

Confirming the Process of Making Laws

Viewing Administrative System Design and Public Comments

Viewing Precedents

Viewing Case Law Doctrines and the Labor Contract Act

Viewing Specific Examples of Trials Leading to Law Revisions

Viewing Workers' Accident Compensation Criteria for Mental Disorders


34. Conclusion – Laws Are Not "Finished Products" But "Systems in Operation"

Instead of memorizing laws, cabinet orders, ministerial ordinances, guidelines, notices, proposals, outlines, and certification criteria separately,

INPUT
↓
DEVELOPMENT
↓
PERMISSION
↓
RUNTIME
↓
FEEDBACK

thinking of them this way connects their relationships into a single line.

Social problems, trials, and statistics are INPUT.

Review committees, reports, proposals, and outlines are Analysis / Planning.

Laws are an essential Core Specification of the social system.

Cabinet orders, ministerial ordinances, and guidelines are Detailed Design / Implementation Guides that concretize the Core.

Notices and certification criteria are Runbooks / Rule Engines operating in administrative practice.

Actual operations in enterprises and administration are Runtime.

And trials, statistics, and administrative issues return as Feedback once again.

flowchart LR
    I[INPUT]
    --> D[DEVELOPMENT]
    --> P[PERMISSION]
    --> R[RUNTIME]
    --> F[FEEDBACK]
    --> I

Laws are not static texts flowing unidirectionally from above.

Thinking of them as systems that operate in the massive production environment of society and continue to update while receiving logs

connects systems that you previously remembered as isolated points into a single continuous thread.

And in practical business, you can manage those systems

Source
↓
Requirement
↓
Control
↓
Evidence
↓
Review
↓
Action

.

Structuring with Excel.

Supporting human work with VBA.

Monitoring mechanical deadlines and omissions with PowerShell.

And making final judgments by having humans check primary sources.

This division of labor is also very similar to the design of the legal system itself.


Article Creation Date: September 15, 2026
Laws and administrative standards are subject to revision. When utilizing them for business, exams, or individual cases, please check the latest effective dates, revision histories, and original texts on e-Gov or the jurisdiction's ministry.

Notice
The replacement of IT terms in this article is a metaphor to make the legal system easier to understand. It does not equate the formal legal nature of laws, cabinet orders, ministerial ordinances, guidelines, notices, judicial precedents, etc., with IT terms. Furthermore, the provided Excel, VBA, and PowerShell examples are intended to assist with legal management and do not automate legal judgments.

Disclaimer
This article provides information for the purpose of general system understanding, learning, and business design, and does not constitute legal consultation or legal advice for individual cases.

Document information

Article title
Are Laws Specifications and Trials Production Tests? Understanding Legal Systems Through Input, Implementation, and Feedback
Published
Updated
Source
https://papanda925.com/?p=16030&lang=en

License: Text and original figures for which this site holds the relevant rights are available under CC BY 4.0 , unless otherwise noted. This article may include content created or edited with generative AI. If code has a separate license notice or a linked GitHub repository license, that license takes precedence for the code. Quotations, third-party materials, images, and trademarks are excluded from this license. Usage policy

Copied title and URL