feat: initialize bangwen recruitment aggregation and search engine

- Rust core engine with HTTP ingestion gateway, hybrid search, and white-box resume matching
- Python edge collectors supporting declarative TOML and specialized adapters
- PostgreSQL schema migrations with pgvector embedding support
- Hardened security controls: strict CSP, terminal sanitization, and input boundary validation
- Multi-service container orchestration with dedicated non-root execution
This commit is contained in:
bitfennec
2026-10-23 23:44:10 +08:00
commit 1059be1b62
61 changed files with 10489 additions and 0 deletions
@@ -0,0 +1,32 @@
-- Migration: Fix deduplication constraints and clean up duplicate rows
-- 1. Deduplicate attachments
DELETE FROM attachment a
USING attachment b
WHERE a.announcement_id = b.announcement_id
AND a.url = b.url
AND a.id > b.id;
-- 2. Unique constraint for attachment idempotency
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM pg_constraint WHERE conname = 'uq_attachment_announcement_url'
) THEN
ALTER TABLE attachment ADD CONSTRAINT uq_attachment_announcement_url UNIQUE (announcement_id, url);
END IF;
END $$;
-- 3. Fix invalid self-referencing canonical_id
UPDATE announcement SET canonical_id = NULL WHERE canonical_id = id;
-- 4. Clean duplicate positions and add unique index
DELETE FROM position a
USING position b
WHERE a.announcement_id = b.announcement_id
AND a.post_name = b.post_name
AND COALESCE(a.dept, '') = COALESCE(b.dept, '')
AND a.id > b.id;
CREATE UNIQUE INDEX IF NOT EXISTS uq_position_announcement_post_dept
ON position (announcement_id, post_name, COALESCE(dept, ''));