forked from cflmy/deepseek-harness
Implement the downstream product in `packages/marqdo`: - `@marqdo/mdh-harness`: application home layout, atomic writes, locks, bounded fixed-argv processes, safe tar extraction, Observation 1 and ValueWire validation; - trusted Gitea release discovery, SHA-256/platform/Bundle verification, transactional environment install, rollback and cleanup, CLI Tool changes; - private knowledge collections with strict import policy, the official `marqdo-knowledge` compile/query adapter and a disclosed locator fallback; - Analysis 3 parsing, approved run/call execution, evidence and staleness; - the six model operations (find/read/check/program/ecosystem/knowledge_search); - the `/mdh` workbench over the existing web server with a same-origin fence; - `mdh` launcher, CI/package/upstream scripts and a Woodpecker pipeline. Tests: 28 node:test cases (27 PASS, one network-gated install test also PASS with MDH_TEST_INSTALL=1). Product install/workbench evidence is recorded in docs/mdh/evidence. Part of marqdo#25 (MDH-03..MDH-08).
52 lines
1.8 KiB
Bash
Executable File
52 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Upstream synchronisation helper.
|
|
#
|
|
# `report` shows the accepted product commit, the tracked upstream remote and
|
|
# how far behind it is. `candidate <sha|ref>` creates one `sync/dsh-<short>`
|
|
# branch by a normal merge and runs the component CI; it never pushes and never
|
|
# rewrites `main`.
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")/.."
|
|
root="$PWD"
|
|
command="${1:-report}"
|
|
|
|
case "$command" in
|
|
report)
|
|
echo "application: $(git rev-parse HEAD)"
|
|
echo "origin: $(git remote get-url origin)"
|
|
echo "upstream: $(git remote get-url upstream)"
|
|
git fetch --quiet upstream --tags
|
|
echo "upstream head: $(git rev-parse upstream/master)"
|
|
echo "behind: $(git rev-list --count HEAD..upstream/master) commit(s)"
|
|
echo "accepted upstream bases:"
|
|
git log --merges --grep='upstream' --format=' %h %s' -n 10 || true
|
|
;;
|
|
candidate)
|
|
target="${2:-}"
|
|
if [ -z "$target" ]; then
|
|
echo "usage: scripts/upstream.sh candidate <sha|ref>" >&2
|
|
exit 2
|
|
fi
|
|
git fetch --quiet upstream --tags
|
|
resolved="$(git rev-parse "$target^{commit}")"
|
|
branch="sync/dsh-$(git rev-parse --short "$resolved")"
|
|
if git show-ref --verify --quiet "refs/heads/$branch"; then
|
|
echo "branch already exists: $branch" >&2
|
|
exit 1
|
|
fi
|
|
git switch -c "$branch" main
|
|
if ! git merge --no-ff --no-commit "$resolved"; then
|
|
echo "upstream merge has conflicts; resolve them, run scripts/ci.sh, and record the conflicts in the PR" >&2
|
|
exit 1
|
|
fi
|
|
git commit -m "sync: merge DSH upstream $resolved"
|
|
scripts/ci.sh
|
|
echo "candidate ready on $branch (not pushed)"
|
|
;;
|
|
*)
|
|
echo "usage: scripts/upstream.sh [report|candidate <sha|ref>]" >&2
|
|
exit 2
|
|
;;
|
|
esac
|