Definition of optional non-authoritative cache data for .frog programs
FROG — Free Open Graphical Language
- 1. Overview
- 2. Scope
- 3. Relation with Other Specifications
- 4. Design Goals
- 5. Cache Storage Options
- 6. External
.frog.cacheFile - 7. Embedded
cacheObject - 8. Cache Model
- 9. Cache Object Structure
- 10. Top-Level Fields
- 11. Common Cache Entry Kinds
- 12. Authority and Correctness Rules
- 13. Stale, Invalid, or Partial Cache Handling
- 14. Security Considerations
- 15. Validation Rules
- 16. Examples
- 17. Summary
The cache mechanism stores optional derived data associated with a FROG program.
Its purpose is to accelerate tooling workflows such as loading, validation, indexing, analysis, lowering preparation,
compilation preparation, and execution-oriented representation generation.
A common use case is caching an execution-oriented intermediate representation derived from the canonical source
.frog file. However, cache is not limited to execution-oriented representations and MAY also contain other derived artifacts useful to tools.
Cache data is non-authoritative. The meaning of a FROG program is always defined by canonical source, never by cache content.
Accordingly:
- cache data MUST NOT define program semantics,
- cache data MUST NOT redefine typing, scheduling, structure identity, or observable behavior,
- cache data MUST be safe to delete and regenerate.
This document specifies:
- the role of optional cache artifacts associated with a FROG,
- the boundary between canonical source and derived cache,
- supported cache storage forms,
- a generic cache container structure,
- correctness, validation, and stale-cache handling rules.
This document does not specify:
- the canonical source representation itself,
- the normative execution semantics of the language,
- the definitive standard execution IR,
- the internal architecture of a particular IDE, compiler, or runtime,
- distribution artifacts such as
.frogbin.
The optional top-level cache section belongs to the canonical source specification in Expression/ when cache is embedded inside a .frog file.
However, the same cache model MAY also be serialized as an external sidecar artifact in a separate .frog.cache file.
Its ownership boundary relative to neighboring source and tooling artifacts is:
Source and tooling boundary metadata - descriptive program identity interface - public typed program boundary diagram - authoritative executable graph front_panel - optional user-facing interaction composition icon - optional reusable-node visual identity ide - optional IDE-facing authoring preferences and recoverability metadata cache - optional derived data for tooling acceleration Canonical source owns meaning. Cache owns no meaning.
In particular:
cachedoes not define executable logic. That belongs to canonical source, especiallydiagram.cachedoes not define public API. That belongs tointerface.cachedoes not define descriptive identity. That belongs tometadata.cachedoes not define editor recoverability or source-carried authoring preferences. That belongs toide.
A practical distinction is:
If the data is: - authoritative and needed to understand the program -> canonical source - useful to reopen or author more comfortably -> ide - derived, optional, and safe to regenerate -> cache
- Speed up loading, validation, lowering, and compilation workflows.
- Avoid recomputing derived artifacts when authoritative source has not changed.
- Keep canonical source authoritative and transparent.
- Allow cache to be safely deleted, ignored, or regenerated.
- Prevent cache data from redefining execution semantics.
- Support clean version-control workflows with minimal diff noise.
FROG supports two cache storage options:
- Preferred: a separate sidecar cache file (
.frog.cache) - Allowed but secondary: an embedded
cacheobject inside the canonical.frogfile
The sidecar file is preferred because it keeps canonical source cleaner and reduces noisy diffs, merge conflicts, and unnecessary version-control churn.
Embedded cache is still allowed for workflows where portability, single-file transport, or source-attached derived artifacts are desirable.
A cache sidecar file is associated with a source file by name.
example.frog example.frog.cache
The external cache file MAY be generated automatically by tooling and MAY be deleted at any time. Tools SHOULD regenerate it when needed.
The external cache file is a derived artifact. It is not part of the authoritative source definition of the program.
The sidecar form is the preferred storage strategy for routine tooling workflows.
In some workflows, tools MAY embed cache data directly inside the canonical .frog file as an optional top-level cache object.
If embedded, the cache object:
- MUST remain optional,
- MUST remain non-authoritative,
- MUST NOT be required for correctness,
- MUST be safe to remove without changing program meaning.
Embedded cache is allowed for convenience, but it is generally less desirable than a sidecar file for collaborative source-control workflows.
The cache model is intentionally simple:
Canonical source and derived cache
authoritative source
|
v
+----------------------+
| example.frog |
|----------------------|
| metadata |
| interface |
| connector |
| diagram |
| front_panel |
| icon |
| ide |
| cache (optional) |
+----------+-----------+
|
| derived from authoritative source
v
+----------------------+
| source_fingerprint |
+----------+-----------+
|
v
+----------------------+
| entries |
|----------------------|
| frog.ir |
| frog.validation |
| frog.analysis |
| tool-specific data |
+----------------------+
Cache can be:
- embedded inside .frog
- external in .frog.cache
In all cases cache is:
- derived
- optional
- non-authoritative
- safe to delete
The cache container is a derived snapshot keyed to some identifiable source state. When that source state changes, the cache MAY become stale and SHOULD be treated accordingly.
Recommended cache structure:
"cache": {
"format_version": "0.1",
"generator": {
"tool": "frog-ide",
"version": "0.1.0"
},
"source_fingerprint": "sha256:...",
"entries": {
"frog.ir": {
"kind": "execution_ir",
"schema_version": "0.1",
"created": "2026-03-05T12:00:00Z",
"depends_on": ["interface", "diagram", "front_panel"],
"data": {}
}
}
}
This structure is generic enough to support multiple derived artifacts while keeping a stable, simple contract.
Version of the cache container format.
- MUST be a string if present.
- SHOULD identify the cache-container schema version.
Describes the tool that generated the cache.
"generator": {
"tool": "frog-ide",
"version": "0.1.0"
}
- MUST be an object if present.
- All generator fields are informational only.
- MUST NOT affect program meaning.
Fingerprint of the authoritative source state from which the cache was derived.
- MUST be a string if present.
- SHOULD be stable for identical authoritative source content.
- SHOULD change when authoritative source content changes.
- Tools MUST treat cache as stale if the fingerprint does not match the current authoritative source state.
Collection of named cache entries.
- MUST be an object if present.
- Each property name identifies one cache entry.
- Unknown entries MUST be safely ignorable.
Recommended naming:
frog.*for project-defined common entries- reverse-domain prefixes for tool-specific entries
Examples:
frog.irfrog.validationfrog.analysiscom.graiphic.ide.symbol_index
Each entry SHOULD follow this general structure:
"frog.ir": {
"kind": "execution_ir",
"schema_version": "0.1",
"created": "2026-03-05T12:00:00Z",
"depends_on": ["interface", "diagram", "front_panel"],
"data": {}
}
kind— high-level category of cache entryschema_version— version of the entry payload schemacreated— creation timestamp in ISO-8601 UTC formdepends_on— source sections or stable dependency identifiersdata— opaque JSON payload containing the derived artifact
The data field MAY contain any valid JSON value, but it MUST contain only derived information.
Stores a cached execution-oriented intermediate representation derived from authoritative source.
This is a common and important cache use case. It is intended to accelerate repeated validation, lowering, compilation preparation, and execution preparation.
Stores derived validation outcomes, such as:
- validation status,
- diagnostic counts,
- resolved warning sets,
- last validated profile or target context.
Stores derived structural information, such as:
- symbol indexes,
- dependency analysis results,
- graph summaries,
- editor lookup tables.
Tools MAY store private derived data under their own namespace, provided that the data remains optional, safe to ignore, and non-authoritative.
Cache data MUST be treated as an optimization only.
- Runtimes MUST NOT require cache data to execute a program correctly.
- Runtimes MUST NOT trust cache data as authoritative truth.
- Tools MUST be able to rebuild needed cache data from authoritative source.
- If cache conflicts with authoritative source content, authoritative source content MUST win.
- Removing cache MUST NOT change the meaning of the program.
Embedded cache does not become authoritative merely because it is physically stored inside the .frog file.
Its storage location does not change its semantic status.
Source provenance is not cache. An attestation stored under ide.provenance may include a signature, issuer, digest, or human-review claim for a specific source state. Such evidence is source-carried audit metadata and SHOULD NOT be discarded merely because it is non-executable or because a formatter normally removes derived cache entries.
Authority rule canonical source -> authoritative embedded cache -> not authoritative sidecar cache -> not authoritative Physical proximity to source does not create semantic authority.
Cache data SHOULD be treated as stale when:
source_fingerprintdoes not match the current authoritative source content,format_versionis not supported,- an entry
schema_versionis not supported, - an entry payload fails validation,
- required dependencies listed in
depends_onhave changed, - the cache payload is incomplete or corrupted.
When cache is stale or invalid:
- tools SHOULD discard the invalid portion and regenerate it,
- runtimes MUST ignore cache for correctness decisions,
- tools MAY keep valid entries and regenerate only stale ones.
A malformed or stale cache MUST degrade performance at worst, not correctness.
Cache content MUST NOT be treated as executable truth.
- Tools SHOULD validate cache payloads before use.
- Runtimes MUST validate source-derived executable representations regardless of cache presence.
- Tools SHOULD avoid storing secrets or sensitive information in cache.
- Cache data MAY be treated as untrusted input.
A malformed cache file MUST NOT compromise correctness. At worst, it should be ignored and regenerated.
Implementations MUST enforce the following rules:
- If present, embedded
cacheMUST be a JSON object. - If present, external
.frog.cacheroot content MUST be a JSON object. - If present,
format_versionMUST be a string. - If present,
generatorMUST be an object. - If present,
source_fingerprintMUST be a string. - If present,
entriesMUST be an object. - Each entry value inside
entriesMUST be an object. - If present, entry
kindMUST be a string. - If present, entry
schema_versionMUST be a string or integer. - If present, entry
createdMUST be a string. - If present, entry
depends_onMUST be an array of strings. - Entry
dataMAY be any valid JSON value. - Unknown cache entries MUST be ignorable.
- Invalid, unreadable, stale, or incompatible cache MUST NOT change correctness.
"cache": {
"format_version": "0.1",
"source_fingerprint": "sha256:...",
"entries": {
"frog.ir": {
"kind": "execution_ir",
"schema_version": "0.1",
"data": {}
}
}
}
"cache": {
"format_version": "0.1",
"generator": {
"tool": "frog-ide",
"version": "0.1.0"
},
"source_fingerprint": "sha256:7d1b...c9",
"entries": {
"frog.ir": {
"kind": "execution_ir",
"schema_version": "0.1",
"created": "2026-03-05T12:00:00Z",
"depends_on": ["interface", "diagram", "front_panel"],
"data": {
"graph": {},
"types": {}
}
},
"frog.validation": {
"kind": "validation",
"schema_version": "0.1",
"created": "2026-03-05T12:00:01Z",
"depends_on": ["interface", "diagram"],
"data": {
"valid": true,
"errors": []
}
}
}
}
{
"format_version": "0.1",
"generator": {
"tool": "frog-cli",
"version": "0.1.0"
},
"source_fingerprint": "sha256:7d1b...c9",
"entries": {
"frog.ir": {
"kind": "execution_ir",
"schema_version": "0.1",
"created": "2026-03-05T12:00:00Z",
"depends_on": ["interface", "diagram", "front_panel"],
"data": {
"graph": {}
}
}
}
}
The cache mechanism provides optional acceleration for tooling workflows.
- Preferred storage is a separate
.frog.cachefile. - Embedded cache is allowed but secondary.
- Cache data is derived, optional, and non-authoritative.
- Execution-oriented IR is a primary cache use case, but not the only one.
- Authoritative source content always defines program meaning.
In FROG:
source is authoritative cache is derived cache is optional cache is disposable