diff --git a/.agents/skills/logseq-asset-linker/SKILL.md b/.agents/skills/logseq-asset-linker/SKILL.md index 66fe9806e..e263ee1e1 100644 --- a/.agents/skills/logseq-asset-linker/SKILL.md +++ b/.agents/skills/logseq-asset-linker/SKILL.md @@ -19,7 +19,7 @@ Produce copy-pasteable asset links relative to a page in `pages/`. - Relative links into `assets/` are formed from a typical page location (`logseq/pages/somepage.md`), so they start `../assets/...`. - Image link: `![name](../assets/path)`. File link: `[name](../assets/path)`. Folder link: `[name](../assets/folder)`. - Use `file:/absolute/path` only when the user explicitly wants a direct file link. -- For namespaced assets, convert `/` → `__` (double underscore) in the **filename**, and sanitize non-alphanumeric chars to `_`. +- Read `[[Logseq/Entity/Asset]]` for page ownership and filename mapping; for B2 uploads also read `[[Logseq/Entity/Asset/B2]]`. Derive a flat filename from the full asset page namespace: `/` becomes `___` and the final format segment becomes the extension. Keep spelling inside segments unchanged, and validate names using the entity definition so the mapping is reversible. Local remote copies use `assets/.remote/`; B2 uploads use the filename at the bucket root. Do not invent another path layout. - Always return the result as a code snippet for easy copying. -Read [references/asset-link-construction.md](./references/asset-link-construction.md) for the full use cases, examples, and the `file:///` handling rules. +Read [references/asset-link-construction.md](./references/asset-link-construction.md) for link construction and `file:///` handling. The graph entity definition governs filenames; this reference covers link syntax. diff --git a/.agents/skills/logseq-asset-linker/references/asset-link-construction.md b/.agents/skills/logseq-asset-linker/references/asset-link-construction.md index da5e89c59..676363ecf 100644 --- a/.agents/skills/logseq-asset-linker/references/asset-link-construction.md +++ b/.agents/skills/logseq-asset-linker/references/asset-link-construction.md @@ -1,92 +1,38 @@ -# Constructing a Logseq Asset Link +# Constructing a Logseq asset link -This is an extension to the LFM formatting rules describing how to construct links to assets in the `assets/` directory and its subdirectories. +Read `Logseq/Entity/Asset` for filename mapping and `Logseq/Entity/Asset/B2` +for remote locations. Keep one naming authority in those graph pages. -### Description +## Existing file paths -Convert macOS file paths into relative Markdown links for Logseq. +Calculate the path relative to the page's `pages/` directory. A file at +`/assets/Folder/File.pdf` becomes: -Logseq uses **namespaces**: page titles that use namespaces (e.g., `[[Work/Projects/Logseq]]`) are converted to filenames by replacing slashes (`/`) with double underscores (`__`), resulting in `Work__Projects__Logseq.md`. Any namespace structure like `[[Parent/Child/Grandchild]]` becomes a single file named `Parent__Child__Grandchild.md`. +```markdown +[File](../assets/Folder/File.pdf) +``` -> Note on underscores: **asset filenames** derived from namespaces use **double** underscores (`__`) as in this rule's examples. Page files on disk use **triple** underscores (`___`). Keep them distinct. +Use `![label](location)` for images, audio, and video; use `[label](location)` +for downloadable documents and presets. Percent-encode URL characters in link +locations without changing the file's name. -### Use Case 1: Path Name to Markdown Asset Link +## New asset pages -Given a full file path to an asset: -- Identify the Logseq folder within the path. -- Format a relative link starting from a typical page location (`logseq/pages/`), assuming the page is `logseq/pages/somepage.md`. -- Generate Markdown that can be directly copied into Logseq with correct relative paths. -- Always format the response as a code snippet. +Derive the flat filename from the asset page using the entity definition. +For remotely stored files, the optional local copy is under `assets/.remote/` +and the B2 URL uses that filename directly beneath the garden's bucket. -#### Example -- **USER:** Can you give me the link for `/a/b/c/logseq/assets/Course-101/assignments/week3/notes/course101__assignment__03__notes.pdf`? - ```markdown - ![course101__assignment__03__notes.pdf](../assets/Course-101/assignments/week3/notes/course101__assignment__03__notes.pdf) - ``` +```markdown +![September 24 episode recording](../assets/.remote/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3) +``` -### Use Case 2: Logseq Namespace Name to Asset Path +## Direct file links -- Turn a Logseq page reference from a namespaced name into a filename and an asset path. -- Given `[[A/B/C/D]]`, generate filename `A__B__C__D` of the appropriate type (png, pdf, etc.) and expected location `../assets/A/B/C/D/A__B__C__D`. -- Replace all non-alphanumeric characters with underscores in filenames. +When explicitly requested for a file outside the garden, use a direct file URL: -#### Examples -- PDF filename for `[[Course-101/homework/03/04 linear equations]]`: - ```markdown - Course-101__homework__03__04_linear_equations.pdf - ``` -- Asset path for the same: - ```markdown - ../assets/Course-101/homework/03/04/Course-101__homework__03__04_linear_equations.pdf - ``` -- Link for `[[Projects/Research/Notes]]`: - ```markdown - [Notes](../assets/Projects/Research/Projects__Research__Notes) - ``` -- As a PDF link: - ```markdown - ![Notes](../assets/Projects/Research/Projects__Research__Notes.pdf) - ``` -- As a folder link: - ```markdown - [assets in Projects/Research](../assets/Projects/Research) - ``` -- PNG asset link for `[[Course-101/homework/03/04 linear equations]]`: - ```markdown - ![04_linear_equations.png](../assets/Course-101/homework/03/04/Course-101__homework__03__04_linear_equations.png) - ``` +```markdown +[Recording](file:///Users/username/Documents/recording.wav) +``` -### Handling File Links - -#### 1. File Links with `file:///` Scheme -When a user provides an absolute file path (e.g., `/Users/username/path/to/file.json`), generate a Markdown link with the `file:///` protocol for direct access. -- Input: `/Users/username/documents/projects/example-docs/example-docs_1234567890.json` - ```markdown - [example-docs_1234567890.json](file:/Users/username/documents/projects/example-docs/example-docs_1234567890.json) - ``` - -#### 2. Logseq Asset Links for Files -If a file is part of a Logseq project and a relative link is requested: -- Identify the file's location relative to the Logseq folder structure (typically `logseq/assets/` or `logseq/pages/`). -- Format relative to a typical page location (`logseq/pages/somepage.md`). -- Use Markdown syntax `[name](relative/path/to/file)`. -- Input: `/Users/username/dev/clones/logseq/assets/Folder/File.ext` - ```markdown - [File.ext](../assets/Folder/File.ext) - ``` - -#### 3. Consistent Formatting for Namespaced Assets -- Replace `/` in the namespace with `__` (double underscores). -- Sanitize filenames by replacing non-alphanumeric characters with `_`. -- Generate paths corresponding to the Logseq folder structure. -- Input namespace `[[Folder/Subfolder/File]]` → filename `Folder__Subfolder__File.ext`, path `../assets/Folder/Subfolder/Folder__Subfolder__File.ext`: - ```markdown - [File](../assets/Folder/Subfolder/Folder__Subfolder__File.ext) - ``` - -### Key Rules and Best Practices -- **Absolute Paths for `file:///` Links:** use the `file:///` scheme for direct file paths if explicitly requested. -- **Relative Paths for Logseq Assets:** always calculate relative paths for files in `assets/`. -- **Namespace Conversion:** convert `/` to `__` in asset filenames. -- **Filename Sanitization:** replace non-alphanumeric characters with `_`. -- **Markdown Link Syntax:** `[name](relative/path)` for Logseq links; `[name](file:/absolute/path)` for direct file links. +Return copyable link syntax when asked to construct a link. When writing an asset +page, write the usable link directly into its body. diff --git a/.claude/skills/logseq-asset-linker/SKILL.md b/.claude/skills/logseq-asset-linker/SKILL.md index 9266f4e5a..0eb1078a3 100644 --- a/.claude/skills/logseq-asset-linker/SKILL.md +++ b/.claude/skills/logseq-asset-linker/SKILL.md @@ -17,7 +17,7 @@ Produce copy-pasteable asset links relative to a page in `pages/`. - Relative links into `assets/` are formed from a typical page location (`logseq/pages/somepage.md`), so they start `../assets/...`. - Image link: `![name](../assets/path)`. File link: `[name](../assets/path)`. Folder link: `[name](../assets/folder)`. - Use `file:/absolute/path` only when the user explicitly wants a direct file link. -- For namespaced assets, convert `/` → `__` (double underscore) in the **filename**, and sanitize non-alphanumeric chars to `_`. +- Read `[[Logseq/Entity/Asset]]` for page ownership and filename mapping; for B2 uploads also read `[[Logseq/Entity/Asset/B2]]`. Derive a flat filename from the full asset page namespace: `/` becomes `___` and the final format segment becomes the extension. Keep spelling inside segments unchanged, and validate names using the entity definition so the mapping is reversible. Local remote copies use `assets/.remote/`; B2 uploads use the filename at the bucket root. Do not invent another path layout. - Always return the result as a code snippet for easy copying. -Read [references/asset-link-construction.md](./references/asset-link-construction.md) for the full use cases, examples, and the `file:///` handling rules. +Read [references/asset-link-construction.md](./references/asset-link-construction.md) for link construction and `file:///` handling. The graph entity definition governs filenames; this reference covers link syntax. diff --git a/.claude/skills/logseq-asset-linker/references/asset-link-construction.md b/.claude/skills/logseq-asset-linker/references/asset-link-construction.md index da5e89c59..676363ecf 100644 --- a/.claude/skills/logseq-asset-linker/references/asset-link-construction.md +++ b/.claude/skills/logseq-asset-linker/references/asset-link-construction.md @@ -1,92 +1,38 @@ -# Constructing a Logseq Asset Link +# Constructing a Logseq asset link -This is an extension to the LFM formatting rules describing how to construct links to assets in the `assets/` directory and its subdirectories. +Read `Logseq/Entity/Asset` for filename mapping and `Logseq/Entity/Asset/B2` +for remote locations. Keep one naming authority in those graph pages. -### Description +## Existing file paths -Convert macOS file paths into relative Markdown links for Logseq. +Calculate the path relative to the page's `pages/` directory. A file at +`/assets/Folder/File.pdf` becomes: -Logseq uses **namespaces**: page titles that use namespaces (e.g., `[[Work/Projects/Logseq]]`) are converted to filenames by replacing slashes (`/`) with double underscores (`__`), resulting in `Work__Projects__Logseq.md`. Any namespace structure like `[[Parent/Child/Grandchild]]` becomes a single file named `Parent__Child__Grandchild.md`. +```markdown +[File](../assets/Folder/File.pdf) +``` -> Note on underscores: **asset filenames** derived from namespaces use **double** underscores (`__`) as in this rule's examples. Page files on disk use **triple** underscores (`___`). Keep them distinct. +Use `![label](location)` for images, audio, and video; use `[label](location)` +for downloadable documents and presets. Percent-encode URL characters in link +locations without changing the file's name. -### Use Case 1: Path Name to Markdown Asset Link +## New asset pages -Given a full file path to an asset: -- Identify the Logseq folder within the path. -- Format a relative link starting from a typical page location (`logseq/pages/`), assuming the page is `logseq/pages/somepage.md`. -- Generate Markdown that can be directly copied into Logseq with correct relative paths. -- Always format the response as a code snippet. +Derive the flat filename from the asset page using the entity definition. +For remotely stored files, the optional local copy is under `assets/.remote/` +and the B2 URL uses that filename directly beneath the garden's bucket. -#### Example -- **USER:** Can you give me the link for `/a/b/c/logseq/assets/Course-101/assignments/week3/notes/course101__assignment__03__notes.pdf`? - ```markdown - ![course101__assignment__03__notes.pdf](../assets/Course-101/assignments/week3/notes/course101__assignment__03__notes.pdf) - ``` +```markdown +![September 24 episode recording](../assets/.remote/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3) +``` -### Use Case 2: Logseq Namespace Name to Asset Path +## Direct file links -- Turn a Logseq page reference from a namespaced name into a filename and an asset path. -- Given `[[A/B/C/D]]`, generate filename `A__B__C__D` of the appropriate type (png, pdf, etc.) and expected location `../assets/A/B/C/D/A__B__C__D`. -- Replace all non-alphanumeric characters with underscores in filenames. +When explicitly requested for a file outside the garden, use a direct file URL: -#### Examples -- PDF filename for `[[Course-101/homework/03/04 linear equations]]`: - ```markdown - Course-101__homework__03__04_linear_equations.pdf - ``` -- Asset path for the same: - ```markdown - ../assets/Course-101/homework/03/04/Course-101__homework__03__04_linear_equations.pdf - ``` -- Link for `[[Projects/Research/Notes]]`: - ```markdown - [Notes](../assets/Projects/Research/Projects__Research__Notes) - ``` -- As a PDF link: - ```markdown - ![Notes](../assets/Projects/Research/Projects__Research__Notes.pdf) - ``` -- As a folder link: - ```markdown - [assets in Projects/Research](../assets/Projects/Research) - ``` -- PNG asset link for `[[Course-101/homework/03/04 linear equations]]`: - ```markdown - ![04_linear_equations.png](../assets/Course-101/homework/03/04/Course-101__homework__03__04_linear_equations.png) - ``` +```markdown +[Recording](file:///Users/username/Documents/recording.wav) +``` -### Handling File Links - -#### 1. File Links with `file:///` Scheme -When a user provides an absolute file path (e.g., `/Users/username/path/to/file.json`), generate a Markdown link with the `file:///` protocol for direct access. -- Input: `/Users/username/documents/projects/example-docs/example-docs_1234567890.json` - ```markdown - [example-docs_1234567890.json](file:/Users/username/documents/projects/example-docs/example-docs_1234567890.json) - ``` - -#### 2. Logseq Asset Links for Files -If a file is part of a Logseq project and a relative link is requested: -- Identify the file's location relative to the Logseq folder structure (typically `logseq/assets/` or `logseq/pages/`). -- Format relative to a typical page location (`logseq/pages/somepage.md`). -- Use Markdown syntax `[name](relative/path/to/file)`. -- Input: `/Users/username/dev/clones/logseq/assets/Folder/File.ext` - ```markdown - [File.ext](../assets/Folder/File.ext) - ``` - -#### 3. Consistent Formatting for Namespaced Assets -- Replace `/` in the namespace with `__` (double underscores). -- Sanitize filenames by replacing non-alphanumeric characters with `_`. -- Generate paths corresponding to the Logseq folder structure. -- Input namespace `[[Folder/Subfolder/File]]` → filename `Folder__Subfolder__File.ext`, path `../assets/Folder/Subfolder/Folder__Subfolder__File.ext`: - ```markdown - [File](../assets/Folder/Subfolder/Folder__Subfolder__File.ext) - ``` - -### Key Rules and Best Practices -- **Absolute Paths for `file:///` Links:** use the `file:///` scheme for direct file paths if explicitly requested. -- **Relative Paths for Logseq Assets:** always calculate relative paths for files in `assets/`. -- **Namespace Conversion:** convert `/` to `__` in asset filenames. -- **Filename Sanitization:** replace non-alphanumeric characters with `_`. -- **Markdown Link Syntax:** `[name](relative/path)` for Logseq links; `[name](file:/absolute/path)` for direct file links. +Return copyable link syntax when asked to construct a link. When writing an asset +page, write the usable link directly into its body. diff --git a/.dvc/.gitignore b/.dvc/.gitignore new file mode 100644 index 000000000..528f30c71 --- /dev/null +++ b/.dvc/.gitignore @@ -0,0 +1,3 @@ +/config.local +/tmp +/cache diff --git a/.dvc/config b/.dvc/config new file mode 100644 index 000000000..8e3c63a6d --- /dev/null +++ b/.dvc/config @@ -0,0 +1,5 @@ +[core] + remote = garden +['remote "garden"'] + url = s3://logseq-encode-garden/dvc/ + endpointurl = https://s3.us-east-005.backblazeb2.com diff --git a/.dvcignore b/.dvcignore new file mode 100644 index 000000000..519730552 --- /dev/null +++ b/.dvcignore @@ -0,0 +1,3 @@ +# Add patterns of files dvc should ignore, which could improve +# the performance. Learn more at +# https://dvc.org/doc/user-guide/dvcignore diff --git a/.github/skills/logseq-asset-linker/SKILL.md b/.github/skills/logseq-asset-linker/SKILL.md index 9266f4e5a..0eb1078a3 100644 --- a/.github/skills/logseq-asset-linker/SKILL.md +++ b/.github/skills/logseq-asset-linker/SKILL.md @@ -17,7 +17,7 @@ Produce copy-pasteable asset links relative to a page in `pages/`. - Relative links into `assets/` are formed from a typical page location (`logseq/pages/somepage.md`), so they start `../assets/...`. - Image link: `![name](../assets/path)`. File link: `[name](../assets/path)`. Folder link: `[name](../assets/folder)`. - Use `file:/absolute/path` only when the user explicitly wants a direct file link. -- For namespaced assets, convert `/` → `__` (double underscore) in the **filename**, and sanitize non-alphanumeric chars to `_`. +- Read `[[Logseq/Entity/Asset]]` for page ownership and filename mapping; for B2 uploads also read `[[Logseq/Entity/Asset/B2]]`. Derive a flat filename from the full asset page namespace: `/` becomes `___` and the final format segment becomes the extension. Keep spelling inside segments unchanged, and validate names using the entity definition so the mapping is reversible. Local remote copies use `assets/.remote/`; B2 uploads use the filename at the bucket root. Do not invent another path layout. - Always return the result as a code snippet for easy copying. -Read [references/asset-link-construction.md](./references/asset-link-construction.md) for the full use cases, examples, and the `file:///` handling rules. +Read [references/asset-link-construction.md](./references/asset-link-construction.md) for link construction and `file:///` handling. The graph entity definition governs filenames; this reference covers link syntax. diff --git a/.github/skills/logseq-asset-linker/references/asset-link-construction.md b/.github/skills/logseq-asset-linker/references/asset-link-construction.md index da5e89c59..676363ecf 100644 --- a/.github/skills/logseq-asset-linker/references/asset-link-construction.md +++ b/.github/skills/logseq-asset-linker/references/asset-link-construction.md @@ -1,92 +1,38 @@ -# Constructing a Logseq Asset Link +# Constructing a Logseq asset link -This is an extension to the LFM formatting rules describing how to construct links to assets in the `assets/` directory and its subdirectories. +Read `Logseq/Entity/Asset` for filename mapping and `Logseq/Entity/Asset/B2` +for remote locations. Keep one naming authority in those graph pages. -### Description +## Existing file paths -Convert macOS file paths into relative Markdown links for Logseq. +Calculate the path relative to the page's `pages/` directory. A file at +`/assets/Folder/File.pdf` becomes: -Logseq uses **namespaces**: page titles that use namespaces (e.g., `[[Work/Projects/Logseq]]`) are converted to filenames by replacing slashes (`/`) with double underscores (`__`), resulting in `Work__Projects__Logseq.md`. Any namespace structure like `[[Parent/Child/Grandchild]]` becomes a single file named `Parent__Child__Grandchild.md`. +```markdown +[File](../assets/Folder/File.pdf) +``` -> Note on underscores: **asset filenames** derived from namespaces use **double** underscores (`__`) as in this rule's examples. Page files on disk use **triple** underscores (`___`). Keep them distinct. +Use `![label](location)` for images, audio, and video; use `[label](location)` +for downloadable documents and presets. Percent-encode URL characters in link +locations without changing the file's name. -### Use Case 1: Path Name to Markdown Asset Link +## New asset pages -Given a full file path to an asset: -- Identify the Logseq folder within the path. -- Format a relative link starting from a typical page location (`logseq/pages/`), assuming the page is `logseq/pages/somepage.md`. -- Generate Markdown that can be directly copied into Logseq with correct relative paths. -- Always format the response as a code snippet. +Derive the flat filename from the asset page using the entity definition. +For remotely stored files, the optional local copy is under `assets/.remote/` +and the B2 URL uses that filename directly beneath the garden's bucket. -#### Example -- **USER:** Can you give me the link for `/a/b/c/logseq/assets/Course-101/assignments/week3/notes/course101__assignment__03__notes.pdf`? - ```markdown - ![course101__assignment__03__notes.pdf](../assets/Course-101/assignments/week3/notes/course101__assignment__03__notes.pdf) - ``` +```markdown +![September 24 episode recording](../assets/.remote/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3) +``` -### Use Case 2: Logseq Namespace Name to Asset Path +## Direct file links -- Turn a Logseq page reference from a namespaced name into a filename and an asset path. -- Given `[[A/B/C/D]]`, generate filename `A__B__C__D` of the appropriate type (png, pdf, etc.) and expected location `../assets/A/B/C/D/A__B__C__D`. -- Replace all non-alphanumeric characters with underscores in filenames. +When explicitly requested for a file outside the garden, use a direct file URL: -#### Examples -- PDF filename for `[[Course-101/homework/03/04 linear equations]]`: - ```markdown - Course-101__homework__03__04_linear_equations.pdf - ``` -- Asset path for the same: - ```markdown - ../assets/Course-101/homework/03/04/Course-101__homework__03__04_linear_equations.pdf - ``` -- Link for `[[Projects/Research/Notes]]`: - ```markdown - [Notes](../assets/Projects/Research/Projects__Research__Notes) - ``` -- As a PDF link: - ```markdown - ![Notes](../assets/Projects/Research/Projects__Research__Notes.pdf) - ``` -- As a folder link: - ```markdown - [assets in Projects/Research](../assets/Projects/Research) - ``` -- PNG asset link for `[[Course-101/homework/03/04 linear equations]]`: - ```markdown - ![04_linear_equations.png](../assets/Course-101/homework/03/04/Course-101__homework__03__04_linear_equations.png) - ``` +```markdown +[Recording](file:///Users/username/Documents/recording.wav) +``` -### Handling File Links - -#### 1. File Links with `file:///` Scheme -When a user provides an absolute file path (e.g., `/Users/username/path/to/file.json`), generate a Markdown link with the `file:///` protocol for direct access. -- Input: `/Users/username/documents/projects/example-docs/example-docs_1234567890.json` - ```markdown - [example-docs_1234567890.json](file:/Users/username/documents/projects/example-docs/example-docs_1234567890.json) - ``` - -#### 2. Logseq Asset Links for Files -If a file is part of a Logseq project and a relative link is requested: -- Identify the file's location relative to the Logseq folder structure (typically `logseq/assets/` or `logseq/pages/`). -- Format relative to a typical page location (`logseq/pages/somepage.md`). -- Use Markdown syntax `[name](relative/path/to/file)`. -- Input: `/Users/username/dev/clones/logseq/assets/Folder/File.ext` - ```markdown - [File.ext](../assets/Folder/File.ext) - ``` - -#### 3. Consistent Formatting for Namespaced Assets -- Replace `/` in the namespace with `__` (double underscores). -- Sanitize filenames by replacing non-alphanumeric characters with `_`. -- Generate paths corresponding to the Logseq folder structure. -- Input namespace `[[Folder/Subfolder/File]]` → filename `Folder__Subfolder__File.ext`, path `../assets/Folder/Subfolder/Folder__Subfolder__File.ext`: - ```markdown - [File](../assets/Folder/Subfolder/Folder__Subfolder__File.ext) - ``` - -### Key Rules and Best Practices -- **Absolute Paths for `file:///` Links:** use the `file:///` scheme for direct file paths if explicitly requested. -- **Relative Paths for Logseq Assets:** always calculate relative paths for files in `assets/`. -- **Namespace Conversion:** convert `/` to `__` in asset filenames. -- **Filename Sanitization:** replace non-alphanumeric characters with `_`. -- **Markdown Link Syntax:** `[name](relative/path)` for Logseq links; `[name](file:/absolute/path)` for direct file links. +Return copyable link syntax when asked to construct a link. When writing an asset +page, write the usable link directly into its body. diff --git a/.rulesync/skills/logseq-asset-linker/SKILL.md b/.rulesync/skills/logseq-asset-linker/SKILL.md index a935f1ecb..877fa8aaa 100644 --- a/.rulesync/skills/logseq-asset-linker/SKILL.md +++ b/.rulesync/skills/logseq-asset-linker/SKILL.md @@ -21,7 +21,7 @@ Produce copy-pasteable asset links relative to a page in `pages/`. - Relative links into `assets/` are formed from a typical page location (`logseq/pages/somepage.md`), so they start `../assets/...`. - Image link: `![name](../assets/path)`. File link: `[name](../assets/path)`. Folder link: `[name](../assets/folder)`. - Use `file:/absolute/path` only when the user explicitly wants a direct file link. -- For namespaced assets, convert `/` → `__` (double underscore) in the **filename**, and sanitize non-alphanumeric chars to `_`. +- Read `[[Logseq/Entity/Asset]]` for page ownership and filename mapping; for B2 uploads also read `[[Logseq/Entity/Asset/B2]]`. Derive a flat filename from the full asset page namespace: `/` becomes `___` and the final format segment becomes the extension. Keep spelling inside segments unchanged, and validate names using the entity definition so the mapping is reversible. Local remote copies use `assets/.remote/`; B2 uploads use the filename at the bucket root. Do not invent another path layout. - Always return the result as a code snippet for easy copying. -Read [references/asset-link-construction.md](./references/asset-link-construction.md) for the full use cases, examples, and the `file:///` handling rules. +Read [references/asset-link-construction.md](./references/asset-link-construction.md) for link construction and `file:///` handling. The graph entity definition governs filenames; this reference covers link syntax. diff --git a/.rulesync/skills/logseq-asset-linker/references/asset-link-construction.md b/.rulesync/skills/logseq-asset-linker/references/asset-link-construction.md index da5e89c59..676363ecf 100644 --- a/.rulesync/skills/logseq-asset-linker/references/asset-link-construction.md +++ b/.rulesync/skills/logseq-asset-linker/references/asset-link-construction.md @@ -1,92 +1,38 @@ -# Constructing a Logseq Asset Link +# Constructing a Logseq asset link -This is an extension to the LFM formatting rules describing how to construct links to assets in the `assets/` directory and its subdirectories. +Read `Logseq/Entity/Asset` for filename mapping and `Logseq/Entity/Asset/B2` +for remote locations. Keep one naming authority in those graph pages. -### Description +## Existing file paths -Convert macOS file paths into relative Markdown links for Logseq. +Calculate the path relative to the page's `pages/` directory. A file at +`/assets/Folder/File.pdf` becomes: -Logseq uses **namespaces**: page titles that use namespaces (e.g., `[[Work/Projects/Logseq]]`) are converted to filenames by replacing slashes (`/`) with double underscores (`__`), resulting in `Work__Projects__Logseq.md`. Any namespace structure like `[[Parent/Child/Grandchild]]` becomes a single file named `Parent__Child__Grandchild.md`. +```markdown +[File](../assets/Folder/File.pdf) +``` -> Note on underscores: **asset filenames** derived from namespaces use **double** underscores (`__`) as in this rule's examples. Page files on disk use **triple** underscores (`___`). Keep them distinct. +Use `![label](location)` for images, audio, and video; use `[label](location)` +for downloadable documents and presets. Percent-encode URL characters in link +locations without changing the file's name. -### Use Case 1: Path Name to Markdown Asset Link +## New asset pages -Given a full file path to an asset: -- Identify the Logseq folder within the path. -- Format a relative link starting from a typical page location (`logseq/pages/`), assuming the page is `logseq/pages/somepage.md`. -- Generate Markdown that can be directly copied into Logseq with correct relative paths. -- Always format the response as a code snippet. +Derive the flat filename from the asset page using the entity definition. +For remotely stored files, the optional local copy is under `assets/.remote/` +and the B2 URL uses that filename directly beneath the garden's bucket. -#### Example -- **USER:** Can you give me the link for `/a/b/c/logseq/assets/Course-101/assignments/week3/notes/course101__assignment__03__notes.pdf`? - ```markdown - ![course101__assignment__03__notes.pdf](../assets/Course-101/assignments/week3/notes/course101__assignment__03__notes.pdf) - ``` +```markdown +![September 24 episode recording](../assets/.remote/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3) +``` -### Use Case 2: Logseq Namespace Name to Asset Path +## Direct file links -- Turn a Logseq page reference from a namespaced name into a filename and an asset path. -- Given `[[A/B/C/D]]`, generate filename `A__B__C__D` of the appropriate type (png, pdf, etc.) and expected location `../assets/A/B/C/D/A__B__C__D`. -- Replace all non-alphanumeric characters with underscores in filenames. +When explicitly requested for a file outside the garden, use a direct file URL: -#### Examples -- PDF filename for `[[Course-101/homework/03/04 linear equations]]`: - ```markdown - Course-101__homework__03__04_linear_equations.pdf - ``` -- Asset path for the same: - ```markdown - ../assets/Course-101/homework/03/04/Course-101__homework__03__04_linear_equations.pdf - ``` -- Link for `[[Projects/Research/Notes]]`: - ```markdown - [Notes](../assets/Projects/Research/Projects__Research__Notes) - ``` -- As a PDF link: - ```markdown - ![Notes](../assets/Projects/Research/Projects__Research__Notes.pdf) - ``` -- As a folder link: - ```markdown - [assets in Projects/Research](../assets/Projects/Research) - ``` -- PNG asset link for `[[Course-101/homework/03/04 linear equations]]`: - ```markdown - ![04_linear_equations.png](../assets/Course-101/homework/03/04/Course-101__homework__03__04_linear_equations.png) - ``` +```markdown +[Recording](file:///Users/username/Documents/recording.wav) +``` -### Handling File Links - -#### 1. File Links with `file:///` Scheme -When a user provides an absolute file path (e.g., `/Users/username/path/to/file.json`), generate a Markdown link with the `file:///` protocol for direct access. -- Input: `/Users/username/documents/projects/example-docs/example-docs_1234567890.json` - ```markdown - [example-docs_1234567890.json](file:/Users/username/documents/projects/example-docs/example-docs_1234567890.json) - ``` - -#### 2. Logseq Asset Links for Files -If a file is part of a Logseq project and a relative link is requested: -- Identify the file's location relative to the Logseq folder structure (typically `logseq/assets/` or `logseq/pages/`). -- Format relative to a typical page location (`logseq/pages/somepage.md`). -- Use Markdown syntax `[name](relative/path/to/file)`. -- Input: `/Users/username/dev/clones/logseq/assets/Folder/File.ext` - ```markdown - [File.ext](../assets/Folder/File.ext) - ``` - -#### 3. Consistent Formatting for Namespaced Assets -- Replace `/` in the namespace with `__` (double underscores). -- Sanitize filenames by replacing non-alphanumeric characters with `_`. -- Generate paths corresponding to the Logseq folder structure. -- Input namespace `[[Folder/Subfolder/File]]` → filename `Folder__Subfolder__File.ext`, path `../assets/Folder/Subfolder/Folder__Subfolder__File.ext`: - ```markdown - [File](../assets/Folder/Subfolder/Folder__Subfolder__File.ext) - ``` - -### Key Rules and Best Practices -- **Absolute Paths for `file:///` Links:** use the `file:///` scheme for direct file paths if explicitly requested. -- **Relative Paths for Logseq Assets:** always calculate relative paths for files in `assets/`. -- **Namespace Conversion:** convert `/` to `__` in asset filenames. -- **Filename Sanitization:** replace non-alphanumeric characters with `_`. -- **Markdown Link Syntax:** `[name](relative/path)` for Logseq links; `[name](file:/absolute/path)` for direct file links. +Return copyable link syntax when asked to construct a link. When writing an asset +page, write the usable link directly into its body. diff --git a/assets/.remote/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3.dvc b/assets/.remote/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3.dvc new file mode 100644 index 000000000..e0a1bad42 --- /dev/null +++ b/assets/.remote/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3.dvc @@ -0,0 +1,5 @@ +outs: +- md5: 379cd19ef682994b0b6d58e6091e5c74 + size: 18188163 + hash: md5 + path: GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3 diff --git a/assets/GitP/Session/2026/09/24/handoff.json b/assets/GitP/Session/2026/09/24/handoff.json index 4dd2a8bd6..69e310925 100644 --- a/assets/GitP/Session/2026/09/24/handoff.json +++ b/assets/GitP/Session/2026/09/24/handoff.json @@ -2,7 +2,7 @@ "recorded_on": "2026-09-24", "episode_title": "GitP.26.09.24", "description": "A MicroFreak and Launchpad session.", - "audio_url": "https://f005.backblazeb2.com/file/logseq-encode-garden/gitpa/episodes/2026-09-24/GitP.26.09.24.mp3", + "audio_url": "https://f005.backblazeb2.com/file/logseq-encode-garden/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3", "audio_length": 18188163, "audio_type": "audio/mpeg" } diff --git a/journals/2026_10_04.md b/journals/2026_10_04.md index 05cce1e53..68244aedb 100644 --- a/journals/2026_10_04.md +++ b/journals/2026_10_04.md @@ -3,11 +3,15 @@ - {{embed [[Week/Review/26/10/04 Sun]]}} - # [[Filed]] - entities + - [[Logseq/Entity/Asset]] + - [[Logseq/Entity/Asset/B2]] + - [[Logseq/Entity/Asset/Frontmatter/duration-seconds]] - [[Logseq/Entity/Mise/Task]] - making music + - [[GitP/A/Session/26/09/24-Thu/Asset/Synth/Full/mp3]] - [[GitP/How To/Prepare Podcast Metadata]] - [[GitP/How To/Draft an Episode from Session Assets]] - - [[GitP/Session/26/09/24 Thu/Session Assets]] + - [[GitP/A/Session/26/09/24-Thu/Session Assets]] - [[GitP/A/Log/26/10/04 Sun]] - [[GitP/A/Log/26/10/04 Sun/Dvc for Knowledge Gardens/Plan]] - [[GitP/A/Log/26/10/04 Sun/Fnox/Plan]] @@ -28,6 +32,10 @@ - workbench - [[Person/codekiln/GitHub/logseq-encode-garden]] - # [[Updated]] + - assets + - [[Backblaze/B2]] + - entities + - [[Logseq/Entity/Frontmatter/Definition]] - mise tasks - [[mise/Task]] - [[My/Pref/Dev/mise/Tasks]] diff --git a/pages/Backblaze___B2.md b/pages/Backblaze___B2.md index bbe1300f8..a67317e5a 100644 --- a/pages/Backblaze___B2.md +++ b/pages/Backblaze___B2.md @@ -1,3 +1,4 @@ alias:: [[B2]] - -- # Backblaze B2 \ No newline at end of file +logseq-entity:: [[Logseq/Entity/Software/Project]] +- # [Backblaze B2](https://www.backblaze.com/cloud-storage) + - Cloud object storage with S3-compatible APIs for applications, backups, and media. diff --git a/pages/GitP___A___Log___26___10___04 Sun___Dvc for Knowledge Gardens___Plan.md b/pages/GitP___A___Log___26___10___04 Sun___Dvc for Knowledge Gardens___Plan.md index 7cd14fe77..265baa0f1 100644 --- a/pages/GitP___A___Log___26___10___04 Sun___Dvc for Knowledge Gardens___Plan.md +++ b/pages/GitP___A___Log___26___10___04 Sun___Dvc for Knowledge Gardens___Plan.md @@ -1,15 +1,15 @@ -- # DVC for Knowledge Gardens - - Use `assets/.remote/` for named local working files and the `.dvc` files that describe them. Git stores the `.dvc` metadata; DVC restores selected working files from B2. Public episode URLs refer to separately published objects with stable names. - - The layout has passed a disposable B2 trial. Registering the first asset in the garden and adding the mise tasks are the next actions under Put the layout to work. +# DVC for Knowledge Gardens + - Use `assets/.remote/` for named local working files and the `.dvc` files that describe them. Git stores the `.dvc` metadata; DVC restores selected working files from B2. Public episode URLs refer to separately uploaded files with page-derived names. + - The September 24 MP3 is registered with DVC and restores from B2 into a fresh checkout. Adding the asset tasks and conversion pipeline are the next actions under Put the layout to work. - ## A recording and its metadata - The September 24 MP3 uses this layout: - ~~~text - assets/.remote/GitP/Session/2026/09/24/ - GitP.26.09.24.mp3 # working audio, ignored by Git - GitP.26.09.24.mp3.dvc # path and checksum, committed to Git + assets/.remote/ + GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3 + GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3.dvc ~~~ - - `dvc add assets/.remote/GitP/Session/2026/09/24/GitP.26.09.24.mp3` creates the adjacent `.mp3.dvc` file. Inside that metadata, `path: GitP.26.09.24.mp3` means the MP3 beside the `.dvc` file. [DVC's file format](https://doc.dvc.org/user-guide/project-structure/dvc-files) defines paths relative to the metadata file's directory. - - A fresh clone contains `assets/.remote/GitP/Session/2026/09/24/GitP.26.09.24.mp3.dvc`. Running `dvc pull assets/.remote/GitP/Session/2026/09/24/GitP.26.09.24.mp3.dvc` restores `assets/.remote/GitP/Session/2026/09/24/GitP.26.09.24.mp3`. Running `dvc pull` restores all assets described by the checkout's DVC metadata. [DVC pull targets](https://doc.dvc.org/command-reference/pull) explains selecting one asset. + - `dvc add assets/.remote/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3` creates the adjacent `.mp3.dvc` file. Inside that metadata, `path: GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3` means the MP3 beside the `.dvc` file. [DVC's file format](https://doc.dvc.org/user-guide/project-structure/dvc-files) defines paths relative to the metadata file's directory. + - A fresh clone contains `assets/.remote/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3.dvc`. Running `dvc pull assets/.remote/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3.dvc` restores `assets/.remote/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3`. Running `dvc pull` restores all assets described by the checkout's DVC metadata. [DVC pull targets](https://doc.dvc.org/command-reference/pull) explains selecting one asset. id:: 6ac23ac7-9313-45ac-8535-5e04bba58aa2 - ## What Git stores - Commit the adjacent `.dvc` files and `.dvc/config`. DVC's generated `.dvc/.gitignore` excludes its local cache and runtime files. Pipeline definitions and their result checksums belong in `dvc.yaml` and `dvc.lock` when a conversion pipeline is added. @@ -19,22 +19,26 @@ !/assets/.remote/**/ !/assets/.remote/**/*.dvc ~~~ - - The directory exception lets Git reach nested metadata. The `.dvc` exception makes the metadata eligible for commit. `git add assets/.remote/GitP/Session/2026/09/24/GitP.26.09.24.mp3.dvc` stages the metadata; the MP3 remains ignored. + - The directory exception lets Git reach nested metadata. The `.dvc` exception makes the metadata eligible for commit. `git add assets/.remote/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3.dvc` stages the metadata; the MP3 remains ignored. - ## What B2 stores - Configure the DVC remote as `s3://logseq-encode-garden/dvc/` with endpoint `https://s3.us-east-005.backblazeb2.com`. DVC stores file content beneath that prefix using checksum-derived names such as `dvc/files/md5//`. - DVC reads the checksum in the `.dvc` file to find the B2 object, downloads it to its local `.dvc/cache/`, and restores the named file under `assets/.remote/`. The local path and B2 object name serve different purposes: the local path identifies the recording; the storage name identifies its contents. - `assets/.remote/` contains the files selected for the current checkout. DVC can list and retrieve files represented by that checkout's metadata. Browsing arbitrary existing B2 objects requires the B2 client; those objects gain DVC tracking only when explicitly added or imported. - [[GitP/A/Log/26/10/04 Sun/Fnox/Plan]] supplies the garden's B2 credentials from the encrypted cache on the Mac. [DVC's compatible-server settings](https://doc.dvc.org/user-guide/data-management/remote-storage/amazon-s3#s3-compatible-servers-non-amazon) describes using a Backblaze endpoint with the S3 client. - ## Public episode audio - - The [September 24 podcast MP3](https://f005.backblazeb2.com/file/logseq-encode-garden/gitpa/episodes/2026-09-24/GitP.26.09.24.mp3) is published at `gitpa/episodes/2026-09-24/GitP.26.09.24.mp3`. Listeners and RSS use that stable URL. - - A publication task copies the chosen local MP3 to its named release object and verifies the public URL. `dvc push` uploads versioned DVC content under `dvc/`; publishing gives the approved episode a permanent audience-facing URL. + id:: 6ac28323-0685-4a79-94f7-f6e91774ec3f + - The [September 24 episode MP3](https://f005.backblazeb2.com/file/logseq-encode-garden/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3) is uploaded using the filename from its asset page, [[GitP/A/Session/26/09/24-Thu/Asset/Synth/Full/mp3]]. Gitpa uses this URL when the episode is published. + id:: 6ac28323-8b3f-45d3-94d4-96a7ff4dd448 + - An upload makes the MP3 available at its B2 URL. `dvc push` backs up tracked files under `dvc/`. Merging the Gitpa publication PR lets CI publish the episode to the website and RSS feed. - The public garden tracks approved media. Rough recordings and collected Ableton projects belong to the private garden's private bucket. Each garden uses the same local path convention with its own B2 credentials and DVC remote. - ## Tested layout + - The committed September 24 metadata restored the MP3 from the configured B2 remote into a fresh checkout. The restored audio matched the original; Git contained the `.dvc` metadata and excluded the MP3. - On [[2026-10-04 Sun]], DVC restored the prepared September 24 MP3 from B2 into a fresh Git clone using the adjacent `.dvc` file under `assets/.remote/`. The restored file's SHA-256 matched the original prepared MP3. - The fresh clone contained metadata and omitted the audio. Pulling the September 24 metadata restored only that MP3; a full pull restored the other test asset. Git tracked the `.dvc` files and ignored the working files throughout. - The trial used the garden's cached credentials and a unique B2 prefix under `dvc/layout-trials/`. All trial objects were removed afterward. The original prepared recording and existing public MP3 were left in place. - ## Put the layout to work - - TODO Add garden asset mise tasks for `add`, `fetch`, `push`, and `status`, using [the tested fnox assets profile](https://github.com/codekiln/logseq-encode-garden/blob/main/fnox.toml). `add` takes a local recording path and produces its adjacent `.dvc` file; `fetch` takes that `.dvc` path and restores its recording. - - TODO Initialize DVC in the garden, configure the B2 remote described under What B2 stores, and register [the approved September 24 MP3](https://f005.backblazeb2.com/file/logseq-encode-garden/gitpa/episodes/2026-09-24/GitP.26.09.24.mp3) under the exact local path shown under A recording and its metadata. Commit its metadata after upload and restore succeed. - - TODO Track a WAV-to-MP3 conversion using [the garden media preparation task](https://github.com/codekiln/logseq-encode-garden/blob/main/mise-tasks/gitpa/media/prepare), with input and output paths under `assets/.remote/`. Verify that changing the WAV requires rebuilding its MP3. - - TODO Restore a collected Ableton project into a clean location in the [private knowledge garden](https://github.com/codekiln/logseq-garden) and open the set before migrating more recordings. + - ### [[Ghost Gardener]] requests + - TODO Add garden asset mise tasks for `add`, `fetch`, `push`, and `status`, using [the tested fnox assets profile](https://github.com/codekiln/logseq-encode-garden/blob/main/fnox.toml). `add` takes a local recording path and produces its adjacent `.dvc` file; `fetch` takes that `.dvc` path and restores its recording. + - DONE Initialize DVC in the garden, configure the B2 remote described under What B2 stores, and register [the approved September 24 MP3](https://f005.backblazeb2.com/file/logseq-encode-garden/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3) under the exact local path shown under A recording and its metadata. Commit its metadata after upload and restore succeed. + - TODO Track a WAV-to-MP3 conversion using [the garden media preparation task](https://github.com/codekiln/logseq-encode-garden/blob/main/mise-tasks/gitpa/media/prepare), with input and output paths under `assets/.remote/`. Verify that changing the WAV requires rebuilding its MP3. + - TODO Restore a collected Ableton project into a clean location in the [private knowledge garden](https://github.com/codekiln/logseq-garden) and open the set before migrating more recordings. \ No newline at end of file diff --git a/pages/GitP___A___Log___26___10___04 Sun___Podcast___Plan.md b/pages/GitP___A___Log___26___10___04 Sun___Podcast___Plan.md index b96bb5b35..0b47b14da 100644 --- a/pages/GitP___A___Log___26___10___04 Sun___Podcast___Plan.md +++ b/pages/GitP___A___Log___26___10___04 Sun___Podcast___Plan.md @@ -1,10 +1,10 @@ - # Podcast action plan - Finish the September 24 episode, make asset commands work while the Mac is unattended, then try DVC on a disposable recording. For later sessions, start with the exported WAV and music-making log. The AI prepares the episode, presets, session details, media links, and Gitpa publication PR. The human listens to one MP3 and merges the PR to publish. - ## Finish September 24 - - DOING Complete [September 24 session assets](https://github.com/codekiln/logseq-encode-garden/blob/main/pages/GitP___Session___26___09___24%20Thu___Session%20Assets.md) and the [September 24 episode draft](https://github.com/codekiln/gitpa/blob/main/gitp-garden/pages/Ceremony___2026___09___24.md). + - DOING Complete [September 24 session assets](https://github.com/codekiln/logseq-encode-garden/blob/main/pages/GitP___A___Session___26___09___24-Thu___Session%20Assets.md) and the [September 24 episode draft](https://github.com/codekiln/gitpa/blob/main/gitp-garden/pages/Ceremony___2026___09___24.md). - DONE Check the public MP3 against the prepared local file. Its media type, size, opening audio range, and Backblaze checksum match. - DONE Import the garden's JSON metadata into Gitpa. The existing description and draft page remain intact. The feed check and importer/feed tests pass. - - TODO Listen to [GitP.26.09.24 — prepared episode audio, about 13 minutes](https://f005.backblazeb2.com/file/logseq-encode-garden/gitpa/episodes/2026-09-24/GitP.26.09.24.mp3) and give this recording a go or a no-go for publication. + - TODO Listen to [GitP.26.09.24 — prepared episode audio, about 13 minutes](https://f005.backblazeb2.com/file/logseq-encode-garden/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3) and give this recording a go or a no-go for publication. - TODO AI: Check the description on the [September 24 episode draft](https://github.com/codekiln/gitpa/blob/main/gitp-garden/pages/Ceremony___2026___09___24.md) with [September 24 recording note: MicroFreak and Launchpad](https://github.com/codekiln/logseq-encode-garden/blob/main/pages/Making___Music___Log___26___09___24%20Thu%20-%20GitP%20Reboot%20with%20Novation%20Launchpad.md) and keep the copy grounded in the source note. Keep unsupported preset claims out of the public description. - TODO AI: Prepare a Gitpa publication PR for the [September 24 episode record](https://github.com/codekiln/gitpa/blob/main/gitp-garden/assets/Ceremony/2026/09/24/episode.yml) and [September 24 draft page](https://github.com/codekiln/gitpa/blob/main/gitp-garden/pages/Ceremony___2026___09___24.md). Assign the GUID and publication time, add the public page to the [GitP episode listing](https://github.com/codekiln/gitpa/tree/main/gitp-garden/pages), run `mise run rss:build` in Gitpa, and leave the PR for the human to merge after listening. After the merge, check [the deployed podcast](https://codekiln.github.io/gitpa/) and [RSS feed](https://codekiln.github.io/gitpa/rss.xml). - ## Make unattended asset work practical diff --git a/pages/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full___mp3.md b/pages/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full___mp3.md new file mode 100644 index 000000000..c5757b1e9 --- /dev/null +++ b/pages/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full___mp3.md @@ -0,0 +1,4 @@ +logseq-entity:: [[Logseq/Entity/Asset/B2]] +duration-seconds:: 757.761066 +- # September 24 Episode MP3 + - ![GitP.26.09.24 — episode recording](https://f005.backblazeb2.com/file/logseq-encode-garden/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3) diff --git a/pages/GitP___Session___26___09___24 Thu___Session Assets.md b/pages/GitP___A___Session___26___09___24-Thu___Session Assets.md similarity index 91% rename from pages/GitP___Session___26___09___24 Thu___Session Assets.md rename to pages/GitP___A___Session___26___09___24-Thu___Session Assets.md index fd8c2307b..9f70f2ef2 100644 --- a/pages/GitP___Session___26___09___24 Thu___Session Assets.md +++ b/pages/GitP___A___Session___26___09___24-Thu___Session Assets.md @@ -1,16 +1,16 @@ -- # Session Assets +# Session Assets - Episode: GitP.26.09.24 - [Podcast metadata JSON](../assets/GitP/Session/2026/09/24/handoff.json) - - Session: [[GitP/Session/26/09/24 Thu]] + - Session: [[GitP/A/Session/26/09/24-Thu]] + - [[GitP/A/Session/26/09/24-Thu/Asset/Synth/Full/mp3]] — listen to the episode recording. - Proposed description: A MicroFreak and Launchpad session. - ## Recordings and notes - Source note: [[Making/Music/Log/26/09/24 Thu - GitP Reboot with Novation Launchpad]]. - Prepared MP3: `GitP.26.09.24.mp3`, 12.6 minutes. - - MP3 SHA-256: `599f7e0c070f59b3914316ffec0a4226989dc4d96b01eb333800ea16c1372cdd`. - Ableton tracks: commentary (audio), microfreak (audio), Mixed Output all (audio), Microfreak Midi all (MIDI). - Session note: On the Microfreak, started with Two Op.FM on initialized patch. - Session note: I was using the Session Mode the whole time in Session, with three audio tracks. - - Release audio: [GitP.26.09.24.mp3](https://f005.backblazeb2.com/file/logseq-encode-garden/gitpa/episodes/2026-09-24/GitP.26.09.24.mp3); length and opening range match the prepared MP3. + - Release audio: [GitP.26.09.24.mp3](https://f005.backblazeb2.com/file/logseq-encode-garden/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3); length and opening range match the prepared MP3. - [Recording-day journal](https://github.com/codekiln/logseq-encode-garden/blob/main/journals/2026_09_24.md) links the session note and nearby work. - [MicroFreak manual: Two Op.FM](https://github.com/codekiln/logseq-encode-garden/blob/main/pages/Microfreak___UG___06%20Dig%20Osc___03%20Types___08%20Two%20Op.FM.md) is linked from the session note. - Commentary file (filename and duration match): `commentary 0010 [2026-09-24 190403].aif`, 12.6 minutes. @@ -60,7 +60,7 @@ - The source note supports this description. Commentary transcription remains excluded because its repeated phrases were unreliable. - ## Episode approval - The prepared `GitP.26.09.24.mp3` is the episode recording. Technical file and public-URL checks pass; publication approval remains pending. - - TODO Listen to [GitP.26.09.24 — prepared MP3](https://f005.backblazeb2.com/file/logseq-encode-garden/gitpa/episodes/2026-09-24/GitP.26.09.24.mp3) and give this recording a go or a no-go for publication. + - TODO Listen to [GitP.26.09.24 — prepared MP3](https://f005.backblazeb2.com/file/logseq-encode-garden/GitP___A___Session___26___09___24-Thu___Asset___Synth___Full.mp3) and give this recording a go or a no-go for publication. - ## Publication - On [[2026-10-04 Sun]], the public MP3 passed media type, length, opening-range, and Backblaze checksum checks against the prepared local file. - Re-importing the garden JSON preserved the existing [Gitpa episode draft](https://github.com/codekiln/gitpa/blob/main/gitp-garden/pages/Ceremony___2026___09___24.md) and its description. The feed check and importer/feed tests pass. diff --git a/pages/GitP___How To___Prepare Podcast Metadata.md b/pages/GitP___How To___Prepare Podcast Metadata.md index 3e9791ce8..85362a1f9 100644 --- a/pages/GitP___How To___Prepare Podcast Metadata.md +++ b/pages/GitP___How To___Prepare Podcast Metadata.md @@ -20,7 +20,7 @@ see-also:: [[GitP/House/Back]], [[GitP/House/Front]], [[GitP/mise/Task/episode/d - ~~~sh mise run gitpa:episode:draft -- '/path/to/GitP26.09.24 Project' ~~~ - - The task creates `GitP/Session/26/09/24 Thu/Session Assets` as an LFM page and `assets/GitP/Session/2026/09/24/handoff.json`. + - The task creates `GitP/A/Session/26/09/24-Thu/Session Assets` as an LFM page and `assets/GitP/Session/2026/09/24/handoff.json`. - If several source notes match the date, pass `--note pages/.md`. An explicit `Description:` bullet supplies the proposed description; otherwise the device heading supplies a short proposal. - The JSON contains `recorded_on`, `episode_title`, and `description`. Track names, observations, and source links stay on the session asset page for review. - ### 2. Attach a public MP3 if available @@ -28,7 +28,7 @@ see-also:: [[GitP/House/Back]], [[GitP/House/Front]], [[GitP/mise/Task/episode/d - The task checks media type, length, and the opening audio range against the prepared MP3, plus the Backblaze SHA-1 when supplied. Successful verification adds `audio_url`, `audio_length`, and `audio_type` to the JSON. The session asset page records the local SHA-256. - If speech recognition is useful, pass `--transcript /path/to/whisper.json` to assess existing output. On Apple Silicon macOS, `--transcribe` invokes [[GitP/mise/Task/episode/transcribe]] to run local MLX Whisper on a matching commentary stem; `--model` selects the model. Check recognized speech against the recording before using it in public copy. - ### 3. Review and import the JSON - - Check the session assets against the source log and prepared MP3 metadata. [[GitP/Session/26/09/24 Thu/Session Assets]] and [its JSON export](../assets/GitP/Session/2026/09/24/handoff.json) provide an example. + - Check the session assets against the source log and prepared MP3 metadata. [[GitP/A/Session/26/09/24-Thu/Session Assets]] and [its JSON export](../assets/GitP/Session/2026/09/24/handoff.json) provide an example. - From the Gitpa checkout, import the JSON: - ~~~sh mise run episode:import -- /path/to/garden/assets/GitP/Session/2026/09/24/handoff.json diff --git a/pages/Logseq___Entity___Asset.md b/pages/Logseq___Entity___Asset.md new file mode 100644 index 000000000..61fb0802f --- /dev/null +++ b/pages/Logseq___Entity___Asset.md @@ -0,0 +1,25 @@ +logseq-entity:: [[Logseq/Entity/Definition]] +- # Asset + - In this garden, **Asset** pages represent individual files: recordings, presets, images, PDFs, and other attachments. + - ## Page and filename + - An asset page lives beneath its owner at `/Asset//`. The purpose describes the file; the final segment is its lowercase extension. + - Replace namespace separators with Logseq's `___` separator, then turn the final format segment into the file extension. Keep the spelling inside each segment unchanged. + - Examples + - Diagram: `Course/Asset/Diagram/Overview/png` corresponds to `Course___Asset___Diagram___Overview.png`. + - Recording: `Course/Asset/Audio/First-Lesson/mp3` corresponds to `Course___Asset___Audio___First-Lesson.mp3`. + - Document: `Project/Asset/Reference/Setup/pdf` corresponds to `Project___Asset___Reference___Setup.pdf`. + - Reverse the mapping by turning the extension back into the final segment and replacing `___` with `/`. For example, `Project___Asset___Reference___Setup.pdf` identifies `Project/Asset/Reference/Setup/pdf`. + - ## Valid names + - Namespace separators become `___`; an asset filename contains no `/` or directory structure. + - `___` is reserved for namespace boundaries and cannot occur inside a page segment. Empty segments, control characters, and filesystem-reserved punctuation (`<`, `>`, `:`, `"`, `\`, `|`, `?`, `*`) are invalid. The format segment contains lowercase letters or digits. + - A page name that violates these rules needs a valid name before the asset is stored. Silent punctuation replacement would make the filename ambiguous. + - Hyphens keep new multiword asset purposes readable. Spaces already present in an owner's namespace stay intact; a URL percent-encodes them. Replacing spaces with hyphens would prevent exact recovery of the page name. + - ## Frontmatter and body + - `logseq-entity:: [[Logseq/Entity/Asset]]` identifies a local asset. A B2 asset uses [[Logseq/Entity/Asset/B2]]. Ownership follows the namespace before `/Asset/`. + - [[Logseq/Entity/Asset/Frontmatter/duration-seconds]] records measured audio or video duration when useful. DVC tracks content identity; podcast feed metadata supplies enclosure size and media type. + - The body contains a descriptive heading and the file itself: `![descriptive label](file location)` embeds an image, audio recording, or video; `[descriptive label](file location)` links a downloadable preset or document. + - Other technical facts belong in documented frontmatter when the asset needs them. The page contains only information about the represented file. + - ## Principles + - [[My/Principle/Simplify/Create Uniform Interfaces]]: every attachment uses the same relationship between its page and filename. + - [[My/Principle/Simplify/Don't Repeat Yourself DRY]]: the namespace supplies ownership, the page supplies the filename, and the file link supplies its location. + - [[My/Principle/Make Illegal States Unrepresentable/Discussion]]: valid asset names exclude problematic filename characters and reserve `___` for namespace boundaries, so each filename maps back to one page. diff --git a/pages/Logseq___Entity___Asset___B2.md b/pages/Logseq___Entity___Asset___B2.md new file mode 100644 index 000000000..1308bd8ae --- /dev/null +++ b/pages/Logseq___Entity___Asset___B2.md @@ -0,0 +1,13 @@ +logseq-entity:: [[Logseq/Entity/Definition]] +- # Backblaze B2 Asset + - In this garden, **Backblaze B2 Asset** pages represent files stored in Backblaze B2, following [[Logseq/Entity/Asset]] for filenames, ownership, and page contents. + - ## Storage location + - Upload the page-derived filename at the root of the garden's configured B2 bucket. Its optional local copy uses `assets/.remote/`. + - For `Course/Asset/Diagram/Overview/png`, the filename is `Course___Asset___Diagram___Overview.png` and the local copy is `assets/.remote/Course___Asset___Diagram___Overview.png`. + - The remote URL has the shape `https:///file//Course___Asset___Diagram___Overview.png`. The garden's B2 configuration supplies the host and bucket; URL encoding preserves the filename. + - ## Frontmatter and body + - `logseq-entity:: [[Logseq/Entity/Asset/B2]]` identifies the file as a B2 asset. Shared asset frontmatter and embedded media or download links follow [[Logseq/Entity/Asset]]. + - The body uses the usable remote URL. The URL already identifies the bucket and filename; separate properties would repeat them. + - ## Uploading and backing up + - Uploading makes a file available at its remote location. Publication through a website or podcast feed is a separate step in that site's workflow. + - DVC maintains checksums and restoration metadata separately. A DVC push backs up a tracked file; a named B2 upload supplies the URL used by its asset page. diff --git a/pages/Logseq___Entity___Asset___Frontmatter___duration-seconds.md b/pages/Logseq___Entity___Asset___Frontmatter___duration-seconds.md new file mode 100644 index 000000000..b433a44bb --- /dev/null +++ b/pages/Logseq___Entity___Asset___Frontmatter___duration-seconds.md @@ -0,0 +1,6 @@ +logseq-entity:: [[Logseq/Entity/Frontmatter/Definition]] +- # `duration-seconds::` — playback length + - The measured playback length of an audio or video asset, in seconds. + - ## Values + - A positive number, with fractional seconds allowed. For example, `duration-seconds:: 757.761066`. + - Optional for audio and video assets; omitted for files without a playback duration. diff --git a/pages/Logseq___Entity___Frontmatter___Definition.md b/pages/Logseq___Entity___Frontmatter___Definition.md index af8de86bc..096fff73a 100644 --- a/pages/Logseq___Entity___Frontmatter___Definition.md +++ b/pages/Logseq___Entity___Frontmatter___Definition.md @@ -6,6 +6,7 @@ logseq-entity:: [[Logseq/Entity/Definition]] - A page whose job is to define one custom property belonging to a single entity type: what the property means, which values are permitted, and how an instance uses it. - Not an instance: a shared convention on [[Logseq/Frontmatter]] (those apply to every page, not one type); a [[Logseq/Entity/Definition]] page (that defines an entity type, not a property); an individual permitted value. - ## Naming and namespace + - Ownership follows the namespace: `Logseq/Entity//Frontmatter/` belongs to `Logseq/Entity/`. A separate ownership property or body section would repeat that relationship. - A Frontmatter Definition lives under its owning type at `Logseq/Entity//Frontmatter/`, where `` is the literal frontmatter key it defines, in kebab-case to match the `::` property (for example `dotfiles-dep-stage`). - The `/Frontmatter/` segment is the boundary: above it is the entity definition; at and below it are that type's frontmatter schema and values. - ## Permitted values @@ -16,7 +17,7 @@ logseq-entity:: [[Logseq/Entity/Definition]] - On instances, set `alias:: [[]]` to the literal key the page defines, as `alias:: [[logseq-entity-hierarchy-type]]` on [[Logseq/Entity/Hierarchy/Frontmatter/Type]]. Clicking a key in `:: ` opens the page `[[]]`, and the alias makes that page the definition. - Shared frontmatter conventions live on [[Logseq/Frontmatter]]. - ## Page shape (body) - - Logseq Flavored Markdown. Suggested sections: the property's **meaning**, its **permitted values** (link the value pages, in order), any **rules** between values, and the **owning type**. + - Logseq Flavored Markdown. Suggested sections: the property's **meaning**, its **permitted values** (link the value pages, in order), any **rules** between values, and ownership when the namespace does not already identify it. - ## Relationships to other types - [[Logseq/Entity/Definition]] — defines entity *types*; a Frontmatter Definition defines one *property* a type adds. A type page links its Frontmatter Definitions from its own `## Frontmatter` section. - [[Schema]] — a Frontmatter Definition is a schema: a declared shape a property's value must satisfy to count as valid.