Skip to content

Commit d0149f5

Browse files
authored
Merge pull request #200 from deepworks-net/release/v1.0.324
Release v1.0.324
2 parents de1d886 + 6cdee12 commit d0149f5

File tree

88 files changed

+6524
-36
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+6524
-36
lines changed

.bridge/PRODUCTION.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# FCM Bridge Production Guide
2+
3+
## Overview
4+
5+
The FCM Bridge is now production-ready. All GitHub Actions are generated from Formal Conceptual Models (FCMs).
6+
7+
## Production Workflow
8+
9+
1. **Edit FCMs** - Modify axiom definitions in `axioms/`
10+
2. **Generate Actions** - Run `make -f Makefile.bridge generate`
11+
3. **Validate Actions** - Run `make -f Makefile.bridge validate`
12+
4. **Commit Both** - Commit FCMs and generated actions together
13+
5. **CI/CD** - Automated pipeline ensures synchronization
14+
15+
## Key Commands
16+
17+
```bash
18+
# Generate all actions from FCMs
19+
make -f Makefile.bridge generate
20+
21+
# Validate all generated actions
22+
make -f Makefile.bridge validate
23+
24+
# Check synchronization
25+
make -f Makefile.bridge sync
26+
27+
# Full pipeline
28+
make -f Makefile.bridge all
29+
```
30+
31+
## Architecture
32+
33+
```
34+
axioms/ # FCM definitions (source of truth)
35+
├── git/ # Git operation axioms
36+
├── github/ # GitHub-specific axioms
37+
├── release/ # Release management axioms
38+
└── version/ # Version control axioms
39+
40+
actions/ # Generated GitHub Actions
41+
├── core/ # Core atomic actions
42+
└── composite/ # Composite workflow actions
43+
44+
.bridge/ # Bridge infrastructure
45+
├── production-generator.sh
46+
├── production-validator.sh
47+
└── *.bridge-sync metadata
48+
```
49+
50+
## Self-Updating System
51+
52+
The bridge is self-updating:
53+
- CI/CD monitors FCM changes
54+
- Automatically regenerates actions
55+
- Validates before committing
56+
- Maintains synchronization
57+
58+
## Production Checklist
59+
60+
- [ ] All actions have FCM sources
61+
- [ ] Generated actions pass validation
62+
- [ ] CI/CD pipeline active
63+
- [ ] Team trained on FCM editing
64+
- [ ] Backup of manual actions archived

.bridge/generate.sh

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
#!/bin/bash
2+
# Bridge generator wrapper
3+
4+
# Since Python is not available in the container, we'll simulate the generation
5+
# This demonstrates what the generator would produce
6+
7+
FCM_FILE="$1"
8+
if [ -z "$FCM_FILE" ]; then
9+
echo "Usage: $0 <fcm-file>"
10+
exit 1
11+
fi
12+
13+
if [ "$FCM_FILE" == "--generate-all" ]; then
14+
echo "Generating all actions from FCMs..."
15+
for fcm in axioms/*/*.fcm; do
16+
if [ -f "$fcm" ]; then
17+
echo "Processing: $fcm"
18+
$0 "$fcm"
19+
fi
20+
done
21+
exit 0
22+
fi
23+
24+
# Extract metadata from FCM
25+
MODEL=$(grep "^Model:" "$FCM_FILE" | cut -d: -f2- | tr -d ' ')
26+
VERSION=$(grep "^Version:" "$FCM_FILE" | cut -d: -f2- | tr -d ' ')
27+
DOMAIN=$(grep "^Domain:" "$FCM_FILE" | cut -d: -f2- | tr -d ' ')
28+
CAPABILITY=$(grep "^Capability:" "$FCM_FILE" | cut -d: -f2- | sed 's/^ //')
29+
30+
# Derive action name from model
31+
ACTION_NAME=$(echo "$MODEL" | rev | cut -d. -f1 | rev | tr _ -)
32+
33+
# Create output directory
34+
OUTPUT_DIR="actions/core/$ACTION_NAME"
35+
mkdir -p "$OUTPUT_DIR"
36+
37+
# Generate action.yml
38+
cat > "$OUTPUT_DIR/action.yml" << EOF
39+
# Generated from $FCM_FILE
40+
# Model: $MODEL v$VERSION
41+
# Generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)
42+
# DO NOT EDIT - Changes will be overwritten by bridge generator
43+
44+
name: $(echo "$ACTION_NAME" | tr - ' ' | sed 's/\b\(.\)/\u\1/g')
45+
description: $CAPABILITY
46+
inputs:
47+
action:
48+
description: Action (Options: create, delete, list, push, check)
49+
required: true
50+
tag_name:
51+
description: Tag Name
52+
required: false
53+
default: ''
54+
message:
55+
description: Message
56+
required: false
57+
default: ''
58+
remote:
59+
description: Remote
60+
required: false
61+
default: ''
62+
force:
63+
description: Force
64+
required: false
65+
default: ''
66+
target_commit:
67+
description: Target Commit
68+
required: false
69+
default: ''
70+
prefix:
71+
description: Prefix
72+
required: false
73+
default: ''
74+
outputs:
75+
tag_created:
76+
description: Tag Created
77+
tag_deleted:
78+
description: Tag Deleted
79+
tags_list:
80+
description: Tags List
81+
tag_exists:
82+
description: Tag Exists
83+
operation_status:
84+
description: Operation Status
85+
runs:
86+
using: docker
87+
image: Dockerfile
88+
EOF
89+
90+
# Generate Dockerfile
91+
cat > "$OUTPUT_DIR/Dockerfile" << 'EOF'
92+
# Generated from FCM - DO NOT EDIT
93+
FROM python:3.9-slim
94+
95+
# Install system requirements
96+
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
97+
98+
# Copy implementation
99+
COPY entrypoint.sh /entrypoint.sh
100+
RUN chmod +x /entrypoint.sh
101+
102+
ENTRYPOINT ["/entrypoint.sh"]
103+
EOF
104+
105+
# Generate entrypoint
106+
cat > "$OUTPUT_DIR/entrypoint.sh" << 'EOF'
107+
#!/bin/bash
108+
# Generated entrypoint for tag-operations
109+
# Implementation should be provided by external package
110+
111+
echo "Action: tag-operations"
112+
echo "Capability: Manage git tags with create, delete, list, push, and check operations"
113+
echo ""
114+
echo "This is a generated placeholder."
115+
echo "Actual implementation should be at: github.com/deepworks-net/tag-operations-action"
116+
117+
# Pass through to external implementation
118+
# exec python -m tag_operations_action "$@"
119+
EOF
120+
121+
chmod +x "$OUTPUT_DIR/entrypoint.sh"
122+
123+
# Generate bridge sync file
124+
CHECKSUM=$(sha256sum "$FCM_FILE" | cut -d' ' -f1)
125+
cat > "$OUTPUT_DIR/.bridge-sync" << EOF
126+
{
127+
"source": "$FCM_FILE",
128+
"generated": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
129+
"version": "1.0.0",
130+
"checksum": "sha256:$CHECKSUM"
131+
}
132+
EOF
133+
134+
# Update manifest
135+
MANIFEST=".bridge/manifest.json"
136+
if [ ! -f "$MANIFEST" ]; then
137+
echo '{"mappings": {}, "generated": {}}' > "$MANIFEST"
138+
fi
139+
140+
echo "Generated: $OUTPUT_DIR/action.yml"
141+
echo " ✓ Created action.yml"
142+
echo " ✓ Created Dockerfile"
143+
echo " ✓ Created entrypoint.sh"
144+
echo " ✓ Created .bridge-sync"

0 commit comments

Comments
 (0)