Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"permissions": {
"allow": [
"Bash(markdownlint *)",
"Bash(shellcheck *)",
"Bash(yamllint *)",
"Bash(git add *)",
"Bash(git blame *)",
"Bash(git branch)",
"Bash(git checkout *)",
"Bash(git config --get *)",
"Bash(git describe *)",
"Bash(git diff *)",
"Bash(git fetch *)",
"Bash(git grep *)",
"Bash(git log *)",
"Bash(git ls-files *)",
"Bash(git remote *)",
"Bash(git show *)",
"Bash(git stash list)",
"Bash(git status *)",
"Bash(git tag *)",
"WebFetch"
]
}
}
10 changes: 10 additions & 0 deletions .devcontainer/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copy this file to .devcontainer/.env and adjust the values below.

# Folder containing your other projects, mounted read-only at /reference.
# Defaults to this repository when unset.
REFERENCE_PROJECTS_DIR=/path/to/your/projects

# Timezone for the container. Defaults to UTC when unset.
# Applied at container start, so changing it needs no image rebuild.
TZ=UTC

25 changes: 25 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM mcr.microsoft.com/devcontainers/javascript-node:24-trixie

# Install dependencies
RUN apt-get update \
&& apt-get install --yes --no-install-recommends \
shellcheck \
yamllint \
&& rm --recursive --force /var/lib/apt/lists/*

# Create the shell history mount point up front so the named volume inherits
# node ownership instead of being created as root.
RUN mkdir --parents /commandhistory \
&& chown node:node /commandhistory

USER node
WORKDIR /home/node

# Install markdownlint-cli for linting docs
RUN npm install --global markdownlint-cli@0.48.0

# Install Claude stable (lands in /home/node/.local/bin, already on PATH)
RUN curl --fail --silent --show-error \
--location https://claude.ai/install.sh --output /tmp/install-claude.sh \
&& bash /tmp/install-claude.sh stable \
&& rm /tmp/install-claude.sh
21 changes: 21 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "Aconcagua",
"dockerComposeFile": "docker-compose.yml",
"service": "aconcagua-tools",
"workspaceFolder": "/workspace",
"customizations": {
"vscode": {
"extensions": [
"anthropic.claude-code",
"DavidAnson.vscode-markdownlint",
"mhutchie.git-graph",
"timonwong.shellcheck",
"fnando.linter"
],
"settings": {
"editor.formatOnSave": true
}
}
},
"remoteUser": "node"
}
25 changes: 25 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
services:
aconcagua-tools:
build:
context: .
dockerfile: Dockerfile
volumes:
- ..:/workspace
- claude-code-bashhistory:/commandhistory
- claude-code-config:/home/node/.claude
# Read-only access to other projects for reference.
# Set REFERENCE_PROJECTS_DIR in .devcontainer/.env to the folder
# containing your projects; it is mounted at /reference.
# Defaults to this repository when unset so a rebuild never fails.
- ${REFERENCE_PROJECTS_DIR:-..}:/reference:ro
environment:
# Set TZ in .devcontainer/.env to your local timezone
TZ: ${TZ:-UTC}
# Link the shell history to the persistent volume
HISTFILE: /commandhistory/.bash_history
# Keep the container running so the devcontainer can attach to it
command: sleep infinity

volumes:
claude-code-bashhistory:
claude-code-config:
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
.DS_Store

# Environment variables
.devcontainer/.env

# Claude Code local settings (per-machine overrides, not shared)
.claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,40 @@ AccountDimensionTest >> testComparison [
deny: dimension equals: ( AccountDimension on: 'ARS' symbol: '$' )
]

{ #category : 'tests' }
AccountDimensionTest >> testComparisonOfDerivedDimensions [

| usd btc rate equalRate |
usd := AccountDimension on: 'USD' symbol: '$'.
btc := AccountDimension on: 'BTC' symbol: '₿'.
rate := usd / btc.
equalRate := ( AccountDimension on: usd reference symbol: usd symbol )
/ ( AccountDimension on: btc reference symbol: btc symbol ).

self
assert: rate equals: equalRate;
assert: rate hash equals: equalRate hash;
assert: ( equalRate occurrencesOf: usd ) equals: 1;
assert: ( equalRate occurrencesOf: btc ) equals: -1
]

{ #category : 'tests' }
AccountDimensionTest >> testPrintString [

self assert: ( AccountDimension on: 'USD' symbol: '$' ) printString equals: '$'
]

{ #category : 'tests' }
AccountDimensionTest >> testProductWithEqualDimension [

| usd btc equivalentToUsd |
usd := AccountDimension on: 'USD' symbol: '$'.
btc := AccountDimension on: 'BTC' symbol: '₿'.
equivalentToUsd := AccountDimension on: usd reference symbol: usd symbol.

self
assert: ( usd / btc * equivalentToUsd ) printString equals: '$²₿⁻¹';
assert: usd / btc * equivalentToUsd equals: usd * usd / btc;
assert: ( usd / equivalentToUsd * btc ) printString equals: '₿';
assert: usd / equivalentToUsd * btc equals: btc
]
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,24 @@ UnitOfAccountTest >> testCommensurability [
deny: ( usdt isCommensurableWith: centisecond )
]

{ #category : 'tests' }
UnitOfAccountTest >> testCommensurabilityOfDerivedUnitsBuiltFromEqualUnits [

| rate equalRate |
rate := usd / btc.
equalRate := ( UnitOfAccount on: 'USD' symbol: '$' ) / ( UnitOfAccount on: 'BTC' symbol: '₿' ).

self
assert: rate equals: equalRate;
assert: rate hash equals: equalRate hash;
assert: rate dimension equals: equalRate dimension;
assert: rate dimension hash equals: equalRate dimension hash;
assert: ( rate isCommensurableWith: equalRate );
assert: ( equalRate isCommensurableWith: rate );
assert: 100 * rate equals: 100 * equalRate;
assert: ( 100 * rate ) + ( 100 * equalRate ) equals: 200 * rate
]

{ #category : 'tests' }
UnitOfAccountTest >> testComparison [

Expand Down Expand Up @@ -221,6 +239,21 @@ UnitOfAccountTest >> testQuantityAddition [
assert: ( oneThousandUSDT + oneHundredUSDT ) printString equals: '1100 ₮'
]

{ #category : 'tests' }
UnitOfAccountTest >> testQuantityMultiplication [

| oneBitcoin sixtyThousandUsdt |
oneBitcoin := 1 * btc.
sixtyThousandUsdt := 60000 * usdt.

self
assert: sixtyThousandUsdt / oneBitcoin * ( 10 * btc ) equals: 600000 * usdt;
assert:
sixtyThousandUsdt / oneBitcoin
* ( 10 * ( UnitOfAccount on: btc reference symbol: btc symbol ) )
equals: 600000 * usdt
]

{ #category : 'tests' }
UnitOfAccountTest >> testQuantitySubtraction [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ DerivedDimension class >> composedOfAll: exponentsByDimension [
{ #category : 'private' }
DerivedDimension class >> dictionaryClass [

^ IdentityDictionary
^ Dictionary
]

{ #category : 'instance creation' }
Expand Down
Loading